aboutsummaryrefslogtreecommitdiff
path: root/testing/py3-trio/fix-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/py3-trio/fix-tests.patch')
-rw-r--r--testing/py3-trio/fix-tests.patch96
1 files changed, 0 insertions, 96 deletions
diff --git a/testing/py3-trio/fix-tests.patch b/testing/py3-trio/fix-tests.patch
deleted file mode 100644
index facf30f1d5..0000000000
--- a/testing/py3-trio/fix-tests.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1Merged already. Upstream pull-request: https://github.com/python-trio/trio/pull/1502.patch
2
3From 03f2601503d5d49987c280e0749accbd50a2bb9b Mon Sep 17 00:00:00 2001
4From: "Nathaniel J. Smith" <njs@pobox.com>
5Date: Thu, 7 May 2020 22:20:49 -0700
6Subject: [PATCH 1/4] Add CI for Alpine
7
8Also deletes some old dead code in ci.sh
9---
10 .github/workflows/ci.yml | 24 ++++++++++++++++++++---
11 ci.sh | 41 +++++-----------------------------------
12 2 files changed, 26 insertions(+), 39 deletions(-)
13
14diff --git a/trio/tests/test_socket.py b/trio/tests/test_socket.py
15index c03c8bb8f..47ba558d6 100644
16--- a/trio/tests/test_socket.py
17+++ b/trio/tests/test_socket.py
18@@ -101,11 +101,19 @@ def test_socket_has_some_reexports():
19 async def test_getaddrinfo(monkeygai):
20 def check(got, expected):
21 # win32 returns 0 for the proto field
22- def without_proto(gai_tup):
23- return gai_tup[:2] + (0,) + gai_tup[3:]
24-
25- expected2 = [without_proto(gt) for gt in expected]
26- assert got == expected or got == expected2
27+ # alpine and glibc have inconsistent handling of the canonical name
28+ # field (https://github.com/python-trio/trio/issues/1499)
29+ # Neither gets used much and there isn't much opportunity for us to
30+ # mess them up, so we don't bother checking them
31+ def interesting_fields(gai_tup):
32+ # (family, type, proto, canonname, sockaddr)
33+ family, type, proto, canonname, sockaddr = gai_tup
34+ return (family, type, sockaddr)
35+
36+ def filtered(gai_list):
37+ return [interesting_fields(gai_tup) for gai_tup in gai_list]
38+
39+ assert filtered(got) == filtered(expected)
40
41 # Simple non-blocking non-error cases, ipv4 and ipv6:
42 with assert_checkpoints():
43
44From 68261db43fe79c3a8b5a22659de159fe40329daf Mon Sep 17 00:00:00 2001
45From: "Nathaniel J. Smith" <njs@pobox.com>
46Date: Thu, 7 May 2020 23:31:24 -0700
47Subject: [PATCH 3/4] Another small test tweak to work around an Alpine quirk
48
49---
50 trio/tests/test_socket.py | 4 +++-
51 1 file changed, 3 insertions(+), 1 deletion(-)
52
53diff --git a/trio/tests/test_socket.py b/trio/tests/test_socket.py
54index 47ba558d6..8be7b7ea4 100644
55--- a/trio/tests/test_socket.py
56+++ b/trio/tests/test_socket.py
57@@ -151,8 +151,10 @@ def filtered(gai_list):
58 with assert_checkpoints():
59 with pytest.raises(tsocket.gaierror) as excinfo:
60 await tsocket.getaddrinfo("::1", "12345", type=-1)
61- # Linux, Windows
62+ # Linux + glibc, Windows
63 expected_errnos = {tsocket.EAI_SOCKTYPE}
64+ # Linux + musl
65+ expected_errnos.add(tsocket.EAI_SERVICE)
66 # macOS
67 if hasattr(tsocket, "EAI_BADHINTS"):
68 expected_errnos.add(tsocket.EAI_BADHINTS)
69
70From cdbbd2d84823006309b2aed9b8a86cd86b03670a Mon Sep 17 00:00:00 2001
71From: "Nathaniel J. Smith" <njs@pobox.com>
72Date: Thu, 7 May 2020 23:38:15 -0700
73Subject: [PATCH 4/4] Slightly more accurate comment
74
75---
76 trio/tests/test_socket.py | 6 +++---
77 1 file changed, 3 insertions(+), 3 deletions(-)
78
79diff --git a/trio/tests/test_socket.py b/trio/tests/test_socket.py
80index 8be7b7ea4..4e76711d3 100644
81--- a/trio/tests/test_socket.py
82+++ b/trio/tests/test_socket.py
83@@ -101,10 +101,10 @@ def test_socket_has_some_reexports():
84 async def test_getaddrinfo(monkeygai):
85 def check(got, expected):
86 # win32 returns 0 for the proto field
87- # alpine and glibc have inconsistent handling of the canonical name
88+ # musl and glibc have inconsistent handling of the canonical name
89 # field (https://github.com/python-trio/trio/issues/1499)
90- # Neither gets used much and there isn't much opportunity for us to
91- # mess them up, so we don't bother checking them
92+ # Neither field gets used much and there isn't much opportunity for us
93+ # to mess them up, so we don't bother checking them here
94 def interesting_fields(gai_tup):
95 # (family, type, proto, canonname, sockaddr)
96 family, type, proto, canonname, sockaddr = gai_tup