Skip to content

Commit

Permalink
Ignore TYPE_CHECKING in UT coverage by default (pasqal-io#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
HGSilveri authored Oct 17, 2022
1 parent 4d759f5 commit 93ceb12
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ exclude_lines =
pragma: no cover
# Don't test pass statements
pass
# These lines can never be covered
if TYPE_CHECKING:

omit =
tests/*
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/json/abstract_repr/deserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Waveform,
)

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.sequence import Sequence

with open(Path(__file__).parent / "schema.json") as f:
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/json/abstract_repr/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from pulser.json.exceptions import AbstractReprError
from pulser.register.base_register import QubitId

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.sequence import Sequence
from pulser.sequence._call import _Call

Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/json/abstract_repr/signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import numpy as np

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.parametrized.variable import Variable, VariableItem


Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/parametrized/paramobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from pulser.parametrized import Parametrized

if TYPE_CHECKING:
from pulser.parametrized import Variable # pragma: no cover
from pulser.parametrized import Variable


class OpSupport:
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/register/base_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from pulser.json.utils import obj_to_dict

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.register.register_layout import RegisterLayout

T = TypeVar("T", bound="BaseRegister")
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/register/mappable_reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from pulser.json.utils import obj_to_dict

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.register.base_register import BaseRegister, QubitId
from pulser.register.register_layout import RegisterLayout

Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/sampler/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pulser.sampler.samples import SequenceSamples, _SlmMask

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser import Sequence


Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/sequence/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pulser.parametrized import Parametrized
from pulser.sequence._call import _Call

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.sequence.sequence import Sequence

F = TypeVar("F", bound=Callable)
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/sequence/_seq_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from pulser.pulse import Pulse

if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from pulser.sequence.sequence import Sequence


Expand Down

0 comments on commit 93ceb12

Please sign in to comment.