diff --git a/tests/test_pages.py b/tests/test_pages.py index 315569b9..6aeb1051 100644 --- a/tests/test_pages.py +++ b/tests/test_pages.py @@ -69,6 +69,7 @@ def to_item(self) -> dict: # type: ignore } assert is_injectable(None) is False + assert is_injectable(type(None)) is False assert is_injectable(MyClass) is False assert is_injectable(MyClass()) is False assert is_injectable(MyItemPage) is True diff --git a/web_poet/pages.py b/web_poet/pages.py index b07b759b..99a0f315 100644 --- a/web_poet/pages.py +++ b/web_poet/pages.py @@ -35,10 +35,6 @@ class Injectable(abc.ABC, FieldsMixin): pass -# NoneType is considered as injectable. Required for Optionals to work. -Injectable.register(type(None)) - - def is_injectable(cls: Any) -> bool: """Return True if ``cls`` is a class which inherits from :class:`~.Injectable`."""