(self)
| 136 | self.assertIsInstance(future, GenericAlias) |
| 137 | |
| 138 | def test_isfuture(self): |
| 139 | class MyFuture: |
| 140 | _asyncio_future_blocking = None |
| 141 | |
| 142 | def __init__(self): |
| 143 | self._asyncio_future_blocking = False |
| 144 | |
| 145 | self.assertFalse(asyncio.isfuture(MyFuture)) |
| 146 | self.assertTrue(asyncio.isfuture(MyFuture())) |
| 147 | self.assertFalse(asyncio.isfuture(1)) |
| 148 | |
| 149 | # As `isinstance(Mock(), Future)` returns `False` |
| 150 | self.assertFalse(asyncio.isfuture(mock.Mock())) |
| 151 | |
| 152 | f = self._new_future(loop=self.loop) |
| 153 | self.assertTrue(asyncio.isfuture(f)) |
| 154 | self.assertFalse(asyncio.isfuture(type(f))) |
| 155 | |
| 156 | # As `isinstance(Mock(Future), Future)` returns `True` |
| 157 | self.assertTrue(asyncio.isfuture(mock.Mock(type(f)))) |
| 158 | |
| 159 | f.cancel() |
| 160 | |
| 161 | def test_initial_state(self): |
| 162 | f = self._new_future(loop=self.loop) |
nothing calls this directly
no test coverage detected