We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13cf0d9 commit 6043cb1Copy full SHA for 6043cb1
injector_test.py
@@ -1674,6 +1674,15 @@ def function11(a: int) -> 'InvalidForwardReference':
1674
assert get_bindings(function11) == {'a': int}
1675
1676
1677
+ # This will not inject `None` even if there is a provider configured to provide
1678
+ # str | None elsewhere in the graph because `None` is stripped in
1679
+ @inject
1680
+ def function12(a: str | None):
1681
+ pass
1682
+
1683
+ assert get_bindings(function12) == {'a': str | None}
1684
1685
1686
# Tests https://github.com/alecthomas/injector/issues/202
1687
@pytest.mark.skipif(sys.version_info < (3, 10), reason="Requires Python 3.10+")
1688
def test_get_bindings_for_pep_604():
0 commit comments