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

Method test_basics

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

Source from the content-addressed store, hash-verified

332 self.assertNotEqual(LiteralString, None)
333
334 def test_basics(self):
335 class Foo:
336 def bar(self) -> LiteralString: ...
337 class FooStr:
338 def bar(self) -> 'LiteralString': ...
339 class FooStrTyping:
340 def bar(self) -> 'typing.LiteralString': ...
341
342 for target in [Foo, FooStr, FooStrTyping]:
343 with self.subTest(target=target):
344 self.assertEqual(gth(target.bar), {'return': LiteralString})
345 self.assertIs(get_origin(LiteralString), None)
346
347 def test_repr(self):
348 self.assertEqual(repr(LiteralString), 'typing.LiteralString')

Callers

nothing calls this directly

Calls 4

get_originFunction · 0.90
subTestMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected