mardi 18 août 2015

pytest: If a crash/segfault/etc. occurs during testing, is there a way to make pytest log the crash as a test failure and continue testing?

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.

Aucun commentaire:

Enregistrer un commentaire