Skip to content

Commit 46fd454

Browse files
committed
tests: Fix coverage
1 parent 77cd672 commit 46fd454

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

duties.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
from duty import duty
1616
from duty.callables import coverage, lazy, mkdocs, mypy, pytest, ruff, safety
1717

18-
from git_changelog import Changelog
19-
from git_changelog.commit import AngularConvention
20-
2118
if TYPE_CHECKING:
2219
from duty.context import Context
2320

@@ -298,6 +295,12 @@ def profile(ctx: Context, merge: int = 15) -> None:
298295
Parameters:
299296
merge: Number of times to merge a branch in the temporary repository.
300297
"""
298+
# Do not import those from the top level,
299+
# as it prevents the pytest-cov plugin for marking
300+
# lines executed at import time as covered.
301+
from git_changelog import Changelog
302+
from git_changelog.commit import AngularConvention
303+
301304
try:
302305
from tests.helpers import GitRepo
303306
except ModuleNotFoundError:

0 commit comments

Comments
 (0)