I have a few unit tests written using pytest that have successfully caused segfaults to occur. However if a segfault occurs (on my Mac) during these execution, pytest seems to quit altogether and provide no information on what caused the python interpreter to crash.
Now I could infer from the logs the specific test that was crashing and determine the values used within, but I was wondering if there was any way to be able to somehow log the crash as a regular test failure and keep iterating through my tests without stopping?
If helpful, I can try to conceive an example but I think the question should be pretty self-explanatory.
Using the pytest-xdist plugin it will restart the nodes automatically when they crash, so installing the plugin and running the tests with -n1
should make py.test survive the crashing tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With