-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
py.test with xdist is not executing tests parametrized with random values #594
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
Comments
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): Each subprocess does its own collection of tests. With |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): To work with random values you can do this:
With this, the collection itself is non-random, only the execution involves random numbers. The only reason i leave this issue open is that we need to check about the error reporting. |
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): @hpk42 I think PR9 might be responsible for not reporting anything at all; the purpose of that patch was to not consume the error that happened when xdist collected different number of tests because of some other internal error (for instance that error during .pyc writing, which has been fixed since). Because no internal error is happening here as each slave just has a different collection, I think that problem is just being logged but no further message is appearing in the console. If I'm correct, I would be happy to work on this if someone can give me a pointer or two how can I produce an error in xdist when we detect that different nodes were collected, but without overwriting any previous error that might have happened in a previous step. |
Original comment by BitBucket: pytry, GitHub: pytry: Thanks @hpk42 I'll use proposed solution for random values. Are You going to add some proper message in such case? So the user does not have to think why tests are not running at all? |
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): Hi @Pytry, This has been fixed by this PR. :) Cheers, |
Original comment by BitBucket: pytry, GitHub: pytry: Cool :) |
Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub): @nicoddemus In which case this issue can be closed? |
Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus): Sure, sorry about that. Thanks @flub. |
Originally reported by: BitBucket: pytry, GitHub: pytry
I have noticed the following strange behaviour for pytest and xdist.
When trying to run the test that is parametrized with some randomly selected values the test are not actually run. The same test is executed without any problems if xdist is not used.
Following code can be used to reproduce this.
Without xdists it works fine.
With xdist no test is executed at all with the following output
Versions I'm using:
Additional note:
With some older versions (xdist 1.8 and pytest 2.4.X or 2.5.X do not remember exactly) the xdist was stopping on assertion in dsession.py
Thanks in advance for any help :)
The text was updated successfully, but these errors were encountered: