(self)
| 8001 | self.assertEqual(get_args(gen_cm.__value__[int, None]), (int, types.NoneType)) |
| 8002 | |
| 8003 | def test_async_contextmanager(self): |
| 8004 | class NotACM: |
| 8005 | pass |
| 8006 | self.assertIsInstance(ACM(), typing.AsyncContextManager) |
| 8007 | self.assertNotIsInstance(NotACM(), typing.AsyncContextManager) |
| 8008 | @contextlib.contextmanager |
| 8009 | def manager(): |
| 8010 | yield 42 |
| 8011 | |
| 8012 | cm = manager() |
| 8013 | self.assertNotIsInstance(cm, typing.AsyncContextManager) |
| 8014 | self.assertEqual(typing.AsyncContextManager[int].__args__, (int, bool | None)) |
| 8015 | with self.assertRaises(TypeError): |
| 8016 | isinstance(42, typing.AsyncContextManager[int]) |
| 8017 | with self.assertRaises(TypeError): |
| 8018 | typing.AsyncContextManager[int, str, float] |
| 8019 | |
| 8020 | def test_asynccontextmanager_type_params(self): |
| 8021 | cm1 = typing.AsyncContextManager[int] |
nothing calls this directly
no test coverage detected