MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_optional_issubclass

Method test_optional_issubclass

Lib/test/test_typing.py:2075–2081  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2073 issubclass(int, Union[list[int], str])
2074
2075 def test_optional_issubclass(self):
2076 self.assertIsSubclass(int, Optional[int])
2077 self.assertIsSubclass(type(None), Optional[int])
2078 self.assertNotIsSubclass(str, Optional[int])
2079 self.assertIsSubclass(Any, Optional[Any])
2080 self.assertIsSubclass(type(None), Optional[Any])
2081 self.assertNotIsSubclass(int, Optional[Any])
2082
2083 def test_optional_issubclass_type_error(self):
2084 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 2

assertIsSubclassMethod · 0.45
assertNotIsSubclassMethod · 0.45

Tested by

no test coverage detected