Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
digitronik committed Jan 15, 2025
1 parent 4ec7c14 commit 27cde0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies = [
"pygount",
"jira",
"python-dotenv",
# "PyTravisCI",
"python-sonarqube-api",
"cached-property",
"pyyaml",
Expand Down
19 changes: 3 additions & 16 deletions tests/test_code_coverage.py
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion tests/test_unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 27cde0f

Please sign in to comment.