Skip to content

Commit 5610e2a

Browse files
authored
Remove some no longer necessary code (#231)
We no longer support Python versions old enough to warrant these workarounds.
1 parent d7a1a7a commit 5610e2a

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

injector/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,6 @@ def get_bindings(callable: Callable) -> Dict[str, type]:
11191119
>>> get_bindings(function3)
11201120
{'a': <class 'int'>}
11211121
1122-
>>> import sys, pytest
1123-
>>> if sys.version_info < (3, 7, 0):
1124-
... pytest.skip('Python 3.7.0 required for sufficient Annotated support')
1125-
11261122
>>> # The simple case of no @inject but injection requested with Inject[...]
11271123
>>> def function4(a: Inject[int], b: str) -> None:
11281124
... pass

injector_test.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,21 +1544,13 @@ def configure(binder):
15441544
assert injector.get(UserID) == 123
15451545

15461546

1547-
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Requires Python 3.6+")
15481547
def test_dataclass_integration_works():
15491548
import dataclasses
15501549

1551-
# Python 3.6+-only syntax below
1552-
exec(
1553-
"""
1554-
@inject
1555-
@dataclasses.dataclass
1556-
class Data:
1557-
name: str
1558-
""",
1559-
locals(),
1560-
globals(),
1561-
)
1550+
@inject
1551+
@dataclasses.dataclass
1552+
class Data:
1553+
name: str
15621554

15631555
def configure(binder):
15641556
binder.bind(str, to='data')

0 commit comments

Comments
 (0)