-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random order does not take effect with parameter "-n 4" (module pytest-xdist) #46
Comments
For me, trying to use pytest-xdist and pyters-random-order together results into an error during collection of tests. ( Being able to run tests in randomised order in parallel would be great... Anyways, thanks for creating this plugin, it is very helpful even without support for parallel execution! Some info about my setup:
|
`pytest-random-order` is a pytest plugin that randomises the order of tests. This can be useful to detect a test that passes just because it happens to run after an unrelated test that leaves the system in a favourable state. To use it add the `--random-order` to your pytest run. It [can't yet be used](pytest-dev/pytest-random-order#46) with `pytest-xdist` though :(. feat(linux_snippets#Clean old kernels): Clean old kernels The full command is ```bash dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)" | xargs sudo apt-get -y purge ``` To test what packages will it remove use: ```bash dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)" | xargs sudo apt-get --dry-run remove ``` Remember that your running kernel can be obtained by `uname -r`.
I am having the same issue with pytest-xdist: #22 (comment) ( |
I have a solution for this. Ideally I would prepare PR but this project seems not maintained anymore. Put the following to conftest.py and it should work:
|
This is fixed in v1.1.0 thanks to the code provided by @matejsp (apologies for too many mentions in the last few hours, had trouble updating to do the build and publish with github actions) |
Verified, it is fixed in pytest-random-order v1.1.0. |
Could you help to support the scenario of multiple process (the plugin "pytest-xdist": -n 6)?
Thanks.
The text was updated successfully, but these errors were encountered: