From 35af8079bf8dfe1bb2b5b13c8cea2e0e9ab7f908 Mon Sep 17 00:00:00 2001 From: Doug Moyer Date: Wed, 20 Oct 2021 13:51:29 -0400 Subject: [PATCH] fix a bug where a test would not be closed if it had no results --- pytest_testrail/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytest_testrail/plugin.py b/pytest_testrail/plugin.py index 4e3908f..889c1f6 100644 --- a/pytest_testrail/plugin.py +++ b/pytest_testrail/plugin.py @@ -256,10 +256,10 @@ def pytest_sessionfinish(self, session, exitstatus): else: print('[{}] No data published'.format(TESTRAIL_PREFIX)) - if self.close_on_complete and self.testrun_id: - self.close_test_run(self.testrun_id) - elif self.close_on_complete and self.testplan_id: - self.close_test_plan(self.testplan_id) + if self.close_on_complete and self.testrun_id: + self.close_test_run(self.testrun_id) + elif self.close_on_complete and self.testplan_id: + self.close_test_plan(self.testplan_id) print('[{}] End publishing'.format(TESTRAIL_PREFIX)) # plugin