How to report a soft error that would show up in test results, but not cause the xdist worker to exit? #987
vitaly-krugl
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have test generation logic that generates the arguments for
pytest.mark.parameterize(...)
. When this test generation logic runs into an error while generating tests, I would like to be able to report soft errors that would show up in test results as errors (not just in console output), but not cause the xdist worker to exit.What I tried so far, is using
config.notify_exception(...)
from the exception context. However, this is incompatible with the logic inDSession.worker_internal_error
: this function executesself._active_nodes.remove(node)
. And without xdist, pytest fails in another way.So, what's the correct way to report a "soft error" that shows up as an error in test results (not just in console output), but does not cause worker abort, and allows test collection for other objects/modules to continue and their tests to run normally?
Beta Was this translation helpful? Give feedback.
All reactions