Replies: 1 comment 2 replies
-
you take too little of the uuid
please add enough of the random value that its not relatively easy to conflict by accident |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to create objects e.g User class with name, address,email e.t.c with dynamic name, something like user234234 or user2987654,
so I have create Utility class with static method that returns the dynamic text:
@staticmethod def get_random_text(text: str) -> str: return text + str(uuid.uuid4())[:8]
and I have the following fixture:
@pytest.fixture() def user_fixture(): return UserClass(name=Utilities.get_random_text('user'))
the problem is that when I run tests that call the
user_fixture
in parallel with xdist, in some tests I get the same "random text".does anybody have any idea why this happens?
Beta Was this translation helpful? Give feedback.
All reactions