(connector, key, request, transport, protocol, loop, warning)
| 30 | |
| 31 | |
| 32 | def test_del(connector, key, request, transport, protocol, loop, warning): |
| 33 | conn = Connection(connector, key, request, |
| 34 | transport, protocol, loop) |
| 35 | exc_handler = mock.Mock() |
| 36 | loop.set_exception_handler(exc_handler) |
| 37 | |
| 38 | with warning(ResourceWarning): |
| 39 | del conn |
| 40 | gc.collect() |
| 41 | |
| 42 | connector._release.assert_called_with(key, |
| 43 | request, |
| 44 | transport, |
| 45 | protocol, |
| 46 | should_close=True) |
| 47 | msg = {'client_connection': mock.ANY, # conn was deleted |
| 48 | 'message': 'Unclosed connection'} |
| 49 | if loop.get_debug(): |
| 50 | msg['source_traceback'] = mock.ANY |
| 51 | exc_handler.assert_called_with(loop, msg) |
| 52 | |
| 53 | |
| 54 | def test_close(connector, key, request, transport, protocol, loop): |
nothing calls this directly
no test coverage detected