From 27cde0f6d1aa9372ea5e8409738e51b425032ead Mon Sep 17 00:00:00 2001 From: Nikhil Dhandre Date: Wed, 15 Jan 2025 12:59:05 +0530 Subject: [PATCH] fix unit tests --- pyproject.toml | 1 - tests/test_code_coverage.py | 19 +++---------------- tests/test_unittests.py | 1 - 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 840910b..fc9ab74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ dependencies = [ "pygount", "jira", "python-dotenv", -# "PyTravisCI", "python-sonarqube-api", "cached-property", "pyyaml", diff --git a/tests/test_code_coverage.py b/tests/test_code_coverage.py index 5b47da7..5a3e6da 100644 --- a/tests/test_code_coverage.py +++ b/tests/test_code_coverage.py @@ -1,28 +1,15 @@ import pytest from sitreps_client.code_coverage import CodecovCoverage -from sitreps_client.exceptions import CodeCoverageError @pytest.mark.parametrize( "slug", ["digitronik/varmeth", "digitronik/wrong"], ids=["correct", "wrong"] ) -def test_code_coverage_is_available(slug): - codecov = CodecovCoverage(repo_slug=slug, branch="master") +def test_code_coverage(slug): + codecov = CodecovCoverage(repo_slug=slug) if "wrong" in slug: - assert not codecov.is_available + assert not codecov.get_coverage() else: - assert codecov.is_available - - -@pytest.mark.parametrize("branch", ["master", "foo"], ids=["correct", "wrong"]) -def test_code_coverage_branch(branch): - codecov = CodecovCoverage(repo_slug="digitronik/varmeth", branch=branch) - - if branch == "master": assert codecov.get_coverage() - else: - with pytest.raises(CodeCoverageError) as error: - codecov.get_coverage() - assert "Branch not found" in str(error.value) diff --git a/tests/test_unittests.py b/tests/test_unittests.py index e1f368f..7928cc0 100644 --- a/tests/test_unittests.py +++ b/tests/test_unittests.py @@ -37,7 +37,6 @@ def get_summary(self): def test_framework_summary(self, framework, expected): """Test different test frameworks and their results.""" summary = self.get_summary() - print(summary) # Assert framework exists in the summary assert framework in summary