in teamcity/pytest_plugin.py [0:0]
def pytest_sessionfinish(self, session, exitstatus):
if exitstatus > pytest.ExitCode.TESTS_FAILED and self.current_test_item:
test_id = self.format_test_id(self.current_test_item.nodeid, self.current_test_item.location)
self.teamcity.testStopped(
test_id,
message=exitstatus.name if hasattr(exitstatus, 'name') else str(exitstatus),
flowId=test_id
)
self.report_test_finished(test_id)