MCPcopy
hub / github.com/aio-libs/aiohttp / test_del

Function test_del

tests/test_client_connection.py:32–51  ·  view source on GitHub ↗
(connector, key, request, transport, protocol, loop, warning)

Source from the content-addressed store, hash-verified

30
31
32def 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
54def test_close(connector, key, request, transport, protocol, loop):

Callers

nothing calls this directly

Calls 2

ConnectionClass · 0.90
warningFunction · 0.85

Tested by

no test coverage detected