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

Method test_basics

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

Source from the content-addressed store, hash-verified

9389 # Much of this is really testing _TypeAlias.
9390
9391 def test_basics(self):
9392 pat = re.compile('[a-z]+', re.I)
9393 self.assertIsSubclass(pat.__class__, Pattern)
9394 self.assertIsSubclass(type(pat), Pattern)
9395 self.assertIsInstance(pat, Pattern)
9396
9397 mat = pat.search('12345abcde.....')
9398 self.assertIsSubclass(mat.__class__, Match)
9399 self.assertIsSubclass(type(mat), Match)
9400 self.assertIsInstance(mat, Match)
9401
9402 # these should just work
9403 Pattern[Union[str, bytes]]
9404 Match[Union[bytes, str]]
9405
9406 def test_alias_equality(self):
9407 self.assertEqual(Pattern[str], Pattern[str])

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected