Skip to content
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

PyTest: report crashing tests as failed #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

octachrome
Copy link

This change ensures that a test which crashes is reported to TeamCity as failed.

When using PyTest with the pytest-xdist plugin and one of the --forked, --boxed or -n options, tests will execute in Python subprocesses, which means individual tests can crash without crashing the main PyTest process. In case of a crash, the pytest_runtest_logreport hook is called with report.failed == True and report.when == '???' (undocumented behaviour). This PR modifies the TeamCity PyTest plugin to handle this case.

Example output:

##teamcity[testFailed timestamp='2021-08-10T14:39:37.427' details=':-1: running the test CRASHED with signal 11' flowId='Test.test_crash.test_fail' message='Test/test_crash.py:0 (test_fail)' name='Test.test_crash.test_fail']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant