Closed etragas-fathom closed 6 years ago
Interesting. I wonder if this also happens when using --tests-per-worker auto
. I'll write a test to repro the original problem.
I tested, and this issue doesn't occur if you set --workers 1
I suspect there is a diff between running process_with_threads directly and wrapping that in a process
pytest-parallel
just does a normal run when --workers
is 1, so that makes sense. What's odd is there's a test to ensure failures are reported: https://github.com/browsertron/pytest-parallel/blob/2f6a094ebb5a6d274adcdb1942a62dd124252711/tests/test_parallel.py#L4-L18
There must be something else in the reporting that's missing.
But the exit code isn't the same thing as the number of failures right? So would the above test catch that?
It's not the same, but it means there's a disconnect between how pytest does its reporting and how it decides to exit the process.
That test needs assert result.ret == 1
The multiprocessing portion of this library works by monkeypatching values on pytest classes using the multiprocessing
module. Ideally, we'd monkeypatch the testsfailed
counter. The problem is getting a multiprocessing counter to work like a normal integer is non-trivial.
Thanks for reporting this! It should be resolved in 0.0.6
, which is on PyPI now.
Haha excellent! I just came here to report that session.testsfailed was probably the issue. Thank you for fixing this so quickly 👏
Unsure if the issue is specific to me, added the info below to reproduce.
tst.py =