Skip to content

Commit 8d5ba63

Browse files
authored
Stop using pytest-randomly in tests (#112)
This removes the `pytest-randomly` Pytest plugin, as it doesn't play nice with `pytest-xdist`. `pytest-randomly` (among other things) sets the random seed in the beginning of the tests to the current datetime. `pytest-xdist` runs the tests in parallel in multiple runners. When you use these two together, it happens that all of the runners have the same random seed, so if you e.g. [generate random resource names](https://github.com/apify/apify-client-python/blob/13c029e82731138cf67912fe6b375ab61846d4c5/tests/integration/test_request_queue.py#L7-L12), all runners will generate the same ones, leading to conflicts. The other feature of `pytest-randomly`, running the tests in random order to ensure that the tests are not passing just because of some side effects caused by running in a specific order, does not work with `pytest-xdist` at all, so there are zero benefits of using `pytest-randomly` at all.
1 parent 3acb8ba commit 8d5ba63

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77
### Internal changes
88

99
- Fixed integration tests for Actor logger
10+
- Removed `pytest-randomly` Pytest plugin
1011

1112

1213
[1.1.3](../../releases/tag/v1.1.3) - 2023-08-25

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ dev = [
6262
"pytest ~= 7.3.1",
6363
"pytest-asyncio ~= 0.21.0",
6464
"pytest-only ~= 2.0.0",
65-
"pytest-randomly ~= 3.12.0",
6665
"pytest-timeout ~= 2.1.0",
6766
"pytest-xdist ~= 3.3.1",
6867
"respx ~= 0.20.1",

0 commit comments

Comments
 (0)