Skip to content

Commit

Permalink
Ensure the imports from "domdf_python_tools" do not affect its covera…
Browse files Browse the repository at this point in the history
…ge measurements.
  • Loading branch information
domdfcoding committed Mar 8, 2021
1 parent 9fe0947 commit f275803
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions coverage_pyver_pragma/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@

# stdlib
import platform
import sys

# 3rd party
import packaging.specifiers
Expand Down Expand Up @@ -156,6 +157,17 @@
"GRAMMAR",
]

# This ensures coverage.py records the correct coverage for these modules
# when they are under test

for module in [
"domdf_python_tools",
"domdf_python_tools.doctools",
"domdf_python_tools.stringlist",
]:
if module in sys.modules:
del sys.modules[module]


@prettify_docstrings
class VersionTag(packaging.specifiers.SpecifierSet):
Expand Down

0 comments on commit f275803

Please sign in to comment.