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

Method test_basics

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

Source from the content-addressed store, hash-verified

6275class CastTests(BaseTestCase):
6276
6277 def test_basics(self):
6278 self.assertEqual(cast(int, 42), 42)
6279 self.assertEqual(cast(float, 42), 42)
6280 self.assertIs(type(cast(float, 42)), int)
6281 self.assertEqual(cast(Any, 42), 42)
6282 self.assertEqual(cast(list, 42), 42)
6283 self.assertEqual(cast(Union[str, float], 42), 42)
6284 self.assertEqual(cast(AnyStr, 42), 42)
6285 self.assertEqual(cast(None, 42), 42)
6286
6287 def test_errors(self):
6288 # Bogus calls are not expected to fail.

Callers

nothing calls this directly

Calls 3

castFunction · 0.90
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected