Skip to content

Commit

Permalink
Ignoring code coverage on type checking (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Sep 13, 2024
1 parent 5a41b25 commit abd1db4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions armi/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@
from armi import pluginManager
from armi.utils import flags

# Not used during runtime so we could have a coverage drop here. Add the
# pragma line to tell coverage.py to skip this
# https://coverage.readthedocs.io/en/stable/excluding.html
if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from armi.reactor.composites import Composite


Expand Down
6 changes: 1 addition & 5 deletions armi/reactor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@

from armi import plugins

# Provide type checking but avoid circular imports
# Not used during runtime so we could have a coverage drop here. Add the
# pragma line to tell coverage.py to skip this
# https://coverage.readthedocs.io/en/stable/excluding.html
if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from armi.reactor.reactors import Core
from armi.reactor.assemblyLists import SpentFuelPool

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ exclude_also = [
"def __repr__",
"if self\\.debug",

# Don't complain about missing type checking-only code:
"if TYPE_CHECKING",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise KeyboardInterrupt",
Expand Down

0 comments on commit abd1db4

Please sign in to comment.