@pytest.fixture
def login():


    class Dummy:

        def make_user(self):
            return 'New user name'
return Dummy()

def test_something(login):
    a = login.make_user()
b = login.make_user()
assert a == b
Pytest use same fixture twice in one function