Skip to content

Commit

Permalink
chore: Ignore TYPE_CHECKING in coverage by default (#3891)
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 authored May 8, 2024
1 parent 79f4ef7 commit b975831
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/integrations/launch_darkly/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from audit.related_object_type import RelatedObjectType
from projects.models import Project

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from users.models import FFAdminUser


Expand Down
7 changes: 7 additions & 0 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ exclude = '''
)/
'''

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
'if TYPE_CHECKING:',
'@(abc\\.)?abstractmethod',
]

[tool.isort]
use_parentheses = true
multi_line_output = 3
Expand Down
2 changes: 1 addition & 1 deletion api/tests/unit/util/mappers/test_unit_mappers_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from util.mappers import dynamodb
from util.mappers.engine import map_feature_state_to_engine

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pytest_mock import MockerFixture

from environments.identities.models import Identity
Expand Down
2 changes: 1 addition & 1 deletion api/tests/unit/util/mappers/test_unit_mappers_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from segments.models import Segment, SegmentRule
from util.mappers import engine

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from environments.identities import Identity, Trait
from environments.models import EnvironmentAPIKey
from features.models import Feature
Expand Down
2 changes: 1 addition & 1 deletion api/util/mappers/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
map_identity_to_engine,
)

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from flag_engine.identities.models import IdentityModel

from environments.identities.models import Identity
Expand Down
2 changes: 1 addition & 1 deletion api/util/mappers/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
SegmentRuleModel,
)

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from environments.identities.models import Identity, Trait
from environments.models import Environment, EnvironmentAPIKey
from features.models import Feature, FeatureSegment, FeatureState
Expand Down

0 comments on commit b975831

Please sign in to comment.