MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_errors

Method test_errors

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

Source from the content-addressed store, hash-verified

2617 My[[Callable[[int, bool, bytes, str], float], float], float])
2618
2619 def test_errors(self):
2620 Callable = self.Callable
2621 alias = Callable[[int, str], float]
2622 with self.assertRaisesRegex(TypeError, "is not a generic class"):
2623 alias[int]
2624 P = ParamSpec('P')
2625 C1 = Callable[P, T]
2626 with self.assertRaisesRegex(TypeError, "many arguments for"):
2627 C1[int, str, str]
2628 with self.assertRaisesRegex(TypeError, "few arguments for"):
2629 C1[int]
2630
2631
2632class TypingCallableTests(BaseCallableTests, BaseTestCase):

Callers

nothing calls this directly

Calls 2

ParamSpecClass · 0.85
assertRaisesRegexMethod · 0.80

Tested by

no test coverage detected