Skip to content

Commit

Permalink
Skip non-contiguous buffer tests on NotImplementedError (pypy)
Browse files Browse the repository at this point in the history
PyPy3.9 7.3.9 does not implement creating contiguous buffers from
non-contiguous, causing the respective tests to fail due to
NotImplementedError.  Catch it and skip the tests appropriately
as discussed in python-websockets#1157.

Fixes python-websockets#1158
  • Loading branch information
mgorny authored and aaugustin committed Apr 17, 2022
1 parent 8a58de2 commit 81cb6f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ def test_apply_mask_check_mask_length(self):
class SpeedupsTests(ApplyMaskTests):
@staticmethod
def apply_mask(*args, **kwargs):
return c_apply_mask(*args, **kwargs)
try:
return c_apply_mask(*args, **kwargs)
except NotImplementedError as e:
# PyPy3.9 as of 7.3.9 does not implement creating
# contiguous buffers from non-contiguous and raises
# NotImplementedError. Catch it and skip the test.
raise unittest.SkipTest(str(e))

0 comments on commit 81cb6f5

Please sign in to comment.