Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Ignore TYPE_CHECKING in coverage by default #3891

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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