(self)
| 7920 | self.assertEqual(get_args(gen_cm.__value__[int, None]), (int, types.NoneType)) |
| 7921 | |
| 7922 | def test_async_contextmanager(self): |
| 7923 | class NotACM: |
| 7924 | pass |
| 7925 | self.assertIsInstance(ACM(), typing.AsyncContextManager) |
| 7926 | self.assertNotIsInstance(NotACM(), typing.AsyncContextManager) |
| 7927 | @contextlib.contextmanager |
| 7928 | def manager(): |
| 7929 | yield 42 |
| 7930 | |
| 7931 | cm = manager() |
| 7932 | self.assertNotIsInstance(cm, typing.AsyncContextManager) |
| 7933 | self.assertEqual(typing.AsyncContextManager[int].__args__, (int, bool | None)) |
| 7934 | with self.assertRaises(TypeError): |
| 7935 | isinstance(42, typing.AsyncContextManager[int]) |
| 7936 | with self.assertRaises(TypeError): |
| 7937 | typing.AsyncContextManager[int, str, float] |
| 7938 | |
| 7939 | def test_asynccontextmanager_type_params(self): |
| 7940 | cm1 = typing.AsyncContextManager[int] |
nothing calls this directly
no test coverage detected