Debian Codegraph @

debian/patches/dgit-changes

raw
1 From:
2 Subject: Debian changes
3
4 The Debian packaging of python-aionut is maintained in git, using a workflow
5 similar to the one described in dgit-maint-merge(7).
6 The Debian delta is represented by this one combined patch; there isn't a
7 patch queue that can be represented as a quilt series.
8
9 A detailed breakdown of the changes is available from their canonical
10 representation -- git commits in the packaging repository.
11 For example, to see the changes made by the Debian maintainer in the first
12 upload of upstream version 1.2.3, you could use:
13
14 % git clone https://git.dgit.debian.org/python-aionut
15 % cd python-aionut
16 % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'
17
18 (If you have dgit, use `dgit clone python-aionut`, rather than plain `git clone`.)
19
20 We don't use debian/source/options single-debian-patch because it has bugs.
21 Therefore, NMUs etc. may nevertheless have made additional patches.
22
23 ---
24
25 diff --git a/tests/test_init.py b/tests/test_init.py
26 index 6b421f5..abf8d15 100644
27 --- a/tests/test_init.py
28 +++ b/tests/test_init.py
29 @@ -5,6 +5,7 @@ import socket
30 from asyncio.streams import StreamReader, StreamWriter
31
32 import pytest
33 +import pytest_asyncio
34
35 from aionut import (
36 AIONUTClient,
37 @@ -32,30 +33,31 @@ _CLIENTS: set[AIONUTClient] = set()
38 _SERVERS: set[tuple[asyncio.Server, asyncio.Task[None], socket.socket]] = set()
39
40
41 [email protected](autouse=True)
42 +@pytest_asyncio.fixture(autouse=True)
43 async def cleanup():
44 yield
45 await asyncio.sleep(0)
46 _LOGGER.debug("cleanup")
47 - for client in _CLIENTS:
48 - writer = client._writer
49 - assert writer
50 - writer.write_eof()
51 - await writer.drain()
52 - client.shutdown()
53 - await writer.wait_closed()
54 - for server, task, sock in _SERVERS:
55 - server.close()
56 - await server.wait_closed()
57 - sock.close()
58 - for sock in server.sockets:
59 - sock.close()
60 - task.cancel()
61 - with contextlib.suppress(asyncio.CancelledError):
62 - await task
63 - await asyncio.sleep(0)
64 - _CLIENTS.clear()
65 - _SERVERS.clear()
66 + try:
67 + for client in _CLIENTS:
68 + writer = client._writer
69 + client.shutdown()
70 + if writer is not None:
71 + writer.close()
72 + with contextlib.suppress(ConnectionError, TimeoutError):
73 + await asyncio.wait_for(writer.wait_closed(), timeout=1)
74 + for server, task, sock in _SERVERS:
75 + server.close()
76 + await server.wait_closed()
77 + with contextlib.suppress(OSError):
78 + sock.close()
79 + task.cancel()
80 + with contextlib.suppress(asyncio.CancelledError):
81 + await task
82 + await asyncio.sleep(0)
83 + finally:
84 + _CLIENTS.clear()
85 + _SERVERS.clear()
86
87
88 def make_nut_client(