From b0715fb41405c3a17a191adda0c2a01b35d815b3 Mon Sep 17 00:00:00 2001 From: Mikhail Kidiankin Date: Wed, 16 Oct 2024 15:36:18 +0200 Subject: [PATCH] Fix coverage reporting --- teamcity/pytest_plugin.py | 4 ++-- tests/integration-tests/pytest_integration_test.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/teamcity/pytest_plugin.py b/teamcity/pytest_plugin.py index fe58a88..549bf50 100644 --- a/teamcity/pytest_plugin.py +++ b/teamcity/pytest_plugin.py @@ -392,7 +392,7 @@ def report(self, morfs, outfile=None): for cu in units: try: - analysis = self.coverage._analyze(cu) + analysis = self.coverage._analyze(cu.filename) nums = analysis.numbers total += nums except KeyboardInterrupt: @@ -406,7 +406,7 @@ def report(self, morfs, outfile=None): if typ is NotPython and not cu.should_be_python(): continue - test_id = cu.name + test_id = cu.relname details = convert_error_to_string(err) self.messages.testStarted(test_id, flowId=test_id) diff --git a/tests/integration-tests/pytest_integration_test.py b/tests/integration-tests/pytest_integration_test.py index 35badbe..e81a138 100644 --- a/tests/integration-tests/pytest_integration_test.py +++ b/tests/integration-tests/pytest_integration_test.py @@ -183,9 +183,7 @@ def test_custom_test_items(venv): if sys.version_info >= (2, 6): @pytest.mark.parametrize("coverage_version, pytest_cov_version", [ - ("==4.4.2", "==2.11.1"), - ("==4.5.4", "==2.11.1"), - ("==5.0.1", "==2.11.1"), + ("==7.2.7", "==4.1.0"), # latest ("", ""), ])