MCPcopy Index your code
hub / github.com/python/cpython / test_union_issubclass

Method test_union_issubclass

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

assertIsSubclassMethod · 0.80
assertNotIsSubclassMethod · 0.80

Tested by

no test coverage detected