Skip to content

Commit f9237e6

Browse files
committed
Skip asyncio tests that fail on pypy3.7 nightly
1 parent f3e6260 commit f9237e6

File tree

2 files changed

+55
-14
lines changed

2 files changed

+55
-14
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
python: ['pypy-3.6', 'pypy-3.7', '3.6', '3.7', '3.8', '3.9', '3.6-dev', '3.7-dev', '3.8-dev', '3.9-dev']
41+
# No pypy-3.7 because Trio doesn't support it (nightly is fine, it has a fix we need)
42+
python: ['pypy-3.6', '3.6', '3.7', '3.8', '3.9', '3.6-dev', '3.7-dev', '3.8-dev', '3.9-dev']
4243
check_formatting: ['0']
4344
check_docs: ['0']
4445
pypy_nightly_branch: ['']

tests/python/conftest.py

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,33 +125,73 @@ def skip(rel_id):
125125
"test_tasks.py::RunCoroutineThreadsafeTests::"
126126
"test_run_coroutine_threadsafe_with_timeout"
127127
)
128+
if sys.platform == "win32":
129+
xfail("test_windows_events.py::ProactorLoopCtrlC::test_ctrl_c")
128130

129-
# These fail with ConnectionResetError on Pythons <= 3.7.x
130-
# for some unknown x. (3.7.1 fails, 3.7.5 and 3.7.6 pass;
131-
# older 3.6.x also affected)
132-
if sys.platform != "win32" and sys.version_info < (3, 8):
131+
# The CPython SSL tests ignored here fail with
132+
# ConnectionResetError on Pythons <= 3.7.x for some unknown x.
133+
# (3.7.1 fails, 3.7.5 and 3.7.6 pass; older 3.6.x also affected)
134+
if sys.platform != "win32":
133135
import selectors
134136

137+
xfail_per_eventloop = []
138+
if sys.implementation.name == "pypy":
139+
# pypy uses a different spelling of the certificate
140+
# failure error message which causes this test to spuriously fail
141+
if sys.version_info >= (3, 7):
142+
xfail_per_eventloop += [
143+
"test_create_server_ssl_match_failed"
144+
]
145+
else:
146+
if sys.version_info < (3, 8):
147+
xfail_per_eventloop += [
148+
"test_create_ssl_connection",
149+
"test_create_ssl_unix_connection"
150+
]
151+
if sys.version_info < (3, 7):
152+
xfail_per_eventloop += [
153+
"test_legacy_create_ssl_connection",
154+
"test_legacy_create_ssl_unix_connection",
155+
]
156+
135157
kinds = ("Select",)
136158
for candidate in ("Kqueue", "Epoll", "Poll"):
137159
if hasattr(selectors, candidate + "Selector"):
138160
kinds += (candidate.replace("Epoll", "EPoll"),)
139161
for kind in kinds:
140-
tests = (
141-
"test_create_ssl_connection", "test_create_ssl_unix_connection"
142-
)
162+
for test in xfail_per_eventloop:
163+
xfail("test_events.py::{}EventLoopTests::{}".format(kind, test))
164+
165+
if sys.implementation.name != "pypy":
143166
if sys.version_info < (3, 7):
144-
tests += (
145-
"test_legacy_create_ssl_connection",
146-
"test_legacy_create_ssl_unix_connection",
147-
)
148167
stream_suite = "StreamReaderTests"
149168
else:
150169
stream_suite = "StreamTests"
151-
for test in tests:
152-
xfail("test_events.py::{}EventLoopTests::{}".format(kind, test))
153170
for which in ("open_connection", "open_unix_connection"):
154171
xfail(
155172
"test_streams.py::{}::test_{}_no_loop_ssl"
156173
.format(stream_suite, which)
157174
)
175+
176+
if sys.implementation.name == "pypy" and sys.version_info >= (3, 7):
177+
# This fails due to a trivial difference in how pypy handles IPv6
178+
# addresses
179+
xfail(
180+
"test_base_events.py::BaseEventLoopWithSelectorTests::"
181+
"test_create_connection_ipv6_scope"
182+
)
183+
# This test depends on the C implementation of asyncio.Future, and
184+
# unlike most such tests it is not configured to be skipped if
185+
# the C implementation is not available
186+
xfail(
187+
"test_futures.py::CFutureInheritanceTests::"
188+
"test_inherit_without_calling_super_init"
189+
)
190+
# These tests assume CPython-style immediate finalization of
191+
# objects when they become unreferenced
192+
for test in (
193+
"test_create_connection_memory_leak",
194+
"test_handshake_timeout",
195+
"test_start_tls_client_reg_proto_1",
196+
):
197+
xfail("test_sslproto.py::SelectorStartTLSTests::{}".format(test))

0 commit comments

Comments
 (0)