Skip to content

Commit

Permalink
Improving test coverage by adding _ScopeName to the package
Browse files Browse the repository at this point in the history
  • Loading branch information
56kyle committed Aug 29, 2023
1 parent 04efd3d commit a2e757b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/pytest_static/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from dataclasses import dataclass
from dataclasses import field
from enum import Enum
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import Dict
Expand All @@ -29,9 +28,8 @@
from pytest_static.type_sets import PREDEFINED_TYPE_SETS


if TYPE_CHECKING:
from _pytest.scope import _ScopeName

# Redefines pytest's typing so that we can get 100% test coverage
_ScopeName = Literal["session", "package", "module", "class", "function"]

T = TypeVar("T")

Expand Down Expand Up @@ -176,7 +174,7 @@ def parametrize_types(
ids: Optional[
Union[Iterable[Optional[object]], Callable[[Any], Optional[object]]]
] = None,
scope: "Optional[_ScopeName]" = None,
scope: Optional[_ScopeName] = None,
*,
_param_mark: Optional[Mark] = None,
) -> None:
Expand Down
11 changes: 9 additions & 2 deletions tests/unit_tests/test_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,15 @@ def test__get_parameter_combinations(
== expected_combinations
)

def test__instantiate_each_parameter_combination(self) -> None:
pass
@pytest.mark.parametrize(
argnames=["primary_type"], argvalues=[(dict,)], indirect=True
)
def test__instantiate_each_parameter_combination_with_builtin(
self, expanded_type: ExpandedType
) -> None:
expanded_type._instantiate_each_parameter_combination(
parameter_combinations=[("foo", {"a": "b"})]
)

def test__instantiate_from_signature(self) -> None:
pass
Expand Down

0 comments on commit a2e757b

Please sign in to comment.