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

Method test_basics

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

Source from the content-addressed store, hash-verified

9507 # Much of this is really testing _TypeAlias.
9508
9509 def test_basics(self):
9510 pat = re.compile('[a-z]+', re.I)
9511 self.assertIsSubclass(pat.__class__, Pattern)
9512 self.assertIsSubclass(type(pat), Pattern)
9513 self.assertIsInstance(pat, Pattern)
9514
9515 mat = pat.search('12345abcde.....')
9516 self.assertIsSubclass(mat.__class__, Match)
9517 self.assertIsSubclass(type(mat), Match)
9518 self.assertIsInstance(mat, Match)
9519
9520 # these should just work
9521 Pattern[Union[str, bytes]]
9522 Match[Union[bytes, str]]
9523
9524 def test_alias_equality(self):
9525 self.assertEqual(Pattern[str], Pattern[str])

Callers

nothing calls this directly

Calls 4

assertIsSubclassMethod · 0.80
assertIsInstanceMethod · 0.80
compileMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected