Skip to content

Commit a1a6f4a

Browse files
mweineltphanirithvij
authored andcommitted
python310Packages.websockets: disable failing test
1 parent 30218c5 commit a1a6f4a

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

pkgs/development/python-modules/websockets/default.nix

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,31 @@ buildPythonPackage rec {
2424

2525
nativeBuildInputs = [ setuptools ];
2626

27-
patchPhase = ''
28-
# Disable all tests that need to terminate within a predetermined amount of
29-
# time. This is nondeterministic.
30-
sed -i 's/with self.assertCompletesWithin.*:/if True:/' \
31-
tests/legacy/test_protocol.py
32-
33-
# Disables tests relying on tight timeouts to avoid failures like:
34-
# File "/build/source/tests/legacy/test_protocol.py", line 1270, in test_keepalive_ping_with_no_ping_timeout
35-
# ping_1_again, ping_2 = tuple(self.protocol.pings)
36-
# ValueError: too many values to unpack (expected 2)
37-
for t in \
38-
test_keepalive_ping_stops_when_connection_closing \
39-
test_keepalive_ping_does_not_crash_when_connection_lost \
40-
test_keepalive_ping \
41-
test_keepalive_ping_not_acknowledged_closes_connection \
42-
test_keepalive_ping_with_no_ping_timeout \
43-
; do
44-
sed -i "s/def $t(/def skip_$t(/" tests/legacy/test_protocol.py
45-
done
46-
'';
27+
patchPhase =
28+
''
29+
# Disable all tests that need to terminate within a predetermined amount of
30+
# time. This is nondeterministic.
31+
sed -i 's/with self.assertCompletesWithin.*:/if True:/' \
32+
tests/legacy/test_protocol.py
33+
34+
# Disables tests relying on tight timeouts to avoid failures like:
35+
# File "/build/source/tests/legacy/test_protocol.py", line 1270, in test_keepalive_ping_with_no_ping_timeout
36+
# ping_1_again, ping_2 = tuple(self.protocol.pings)
37+
# ValueError: too many values to unpack (expected 2)
38+
for t in \
39+
test_keepalive_ping_stops_when_connection_closing \
40+
test_keepalive_ping_does_not_crash_when_connection_lost \
41+
test_keepalive_ping \
42+
test_keepalive_ping_not_acknowledged_closes_connection \
43+
test_keepalive_ping_with_no_ping_timeout \
44+
; do
45+
sed -i "s/def $t(/def skip_$t(/" tests/legacy/test_protocol.py
46+
done
47+
''
48+
+ lib.optionalString (pythonOlder "3.11") ''
49+
# Our Python 3.10 and older raise SSLError instead of SSLCertVerificationError
50+
sed -i "s/def test_reject_invalid_server_certificate(/def skip_test_reject_invalid_server_certificate(/" tests/sync/test_client.py
51+
'';
4752

4853
nativeCheckInputs = [ unittestCheckHook ];
4954

0 commit comments

Comments
 (0)