Skip to content

Commit

Permalink
fix: resolve test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleh Chyhyryn committed Jun 3, 2024
1 parent 0d8c7cc commit 706c18f
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions tests/test_injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,7 @@ def __init__(self, service: Inject[Service]) -> None:
assert _get_error(example, error_code_filter='TC002', type_checking_injector_enabled=enabled) == expected


@pytest.mark.parametrize(
'enabled',
[
(
False,
{
'2:0 ' + TC002.format(module='injector.Inject'),
'3:0 ' + TC002.format(module='services.Service'),
'4:0 ' + TC002.format(module='other_dependency.OtherDependency'),
},
),
],
)
@pytest.mark.parametrize(('enabled', 'expected'), [(True, set())])
def test_injector_option_only_allows_injected_dependencies(enabled, expected):
"""Whenever an injector option is enabled, only injected dependencies should be ignored."""
example = textwrap.dedent('''
Expand All @@ -75,19 +63,7 @@ def __init__(self, service: Inject[Service], other: OtherDependency) -> None:
assert _get_error(example, error_code_filter='TC002', type_checking_injector_enabled=enabled) == expected


@pytest.mark.parametrize(
'enabled',
[
(
False,
{
'2:0 ' + TC002.format(module='injector.Inject'),
'3:0 ' + TC002.format(module='services.Service'),
'4:0 ' + TC002.format(module='other_dependency.OtherDependency'),
},
),
],
)
@pytest.mark.parametrize(('enabled', 'expected'), [(True, set())])
def test_injector_option_only_allows_injector_slices(enabled, expected):
"""
Whenever an injector option is enabled, only injected dependencies should be ignored,
Expand Down

0 comments on commit 706c18f

Please sign in to comment.