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

Method test_union_issubclass

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

Source from the content-addressed store, hash-verified

2053 isinstance(None, Optional[Any])
2054
2055 def test_union_issubclass(self):
2056 self.assertIsSubclass(int, Union[int, str])
2057 self.assertIsSubclass(str, Union[int, str])
2058 self.assertNotIsSubclass(float, Union[int, str])
2059 self.assertIsSubclass(int, Union[int, list[int]])
2060 self.assertIsSubclass(int, Union[int, Any])
2061 self.assertNotIsSubclass(int, Union[str, Any])
2062 self.assertIsSubclass(int, Union[Any, int])
2063 self.assertNotIsSubclass(int, Union[Any, str])
2064
2065 def test_union_issubclass_type_error(self):
2066 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 2

assertIsSubclassMethod · 0.45
assertNotIsSubclassMethod · 0.45

Tested by

no test coverage detected