Skip to content

Commit 9f5044d

Browse files
committed
Skip test on PyPy 3.8 and 3.9.
Fails in the latest PyPy release, with both UserList and an ordinary list.
1 parent 1fe24c8 commit 9f5044d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/seq_tests.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
import pickle
1313
import sys
1414
from itertools import chain
15-
from typing import List
15+
from typing import Any, List
1616

1717
# 3rd party
1818
import pytest
1919
from coincidence.selectors import not_pypy
2020

2121
# this package
22+
from domdf_python_tools.compat import PYPY38_PLUS
2223
from domdf_python_tools.iterative import Len
2324

2425

@@ -435,7 +436,7 @@ def test_getitemoverwriteiter(self):
435436
# Verify that __getitem__ overrides are not recognized by __iter__
436437
class T(self.type2test): # type: ignore
437438

438-
def __getitem__(self, key):
439+
def __getitem__(self, key: Any) -> str:
439440
return str(key) + "!!!"
440441

441442
assert next(iter(T((1, 2)))) == 1
@@ -486,8 +487,10 @@ def test_count(self):
486487

487488
assert a.count(ALWAYS_EQ), 9
488489
assert self.type2test([ALWAYS_EQ, ALWAYS_EQ]).count(1) == 2
489-
assert self.type2test([ALWAYS_EQ, ALWAYS_EQ]).count(NEVER_EQ) == 2
490-
assert self.type2test([NEVER_EQ, NEVER_EQ]).count(ALWAYS_EQ) == 0
490+
491+
if not PYPY38_PLUS: # TODO: figure out why the tests fail
492+
assert self.type2test([ALWAYS_EQ, ALWAYS_EQ]).count(NEVER_EQ) == 2
493+
assert self.type2test([NEVER_EQ, NEVER_EQ]).count(ALWAYS_EQ) == 0
491494

492495
with pytest.raises(TypeError):
493496
a.count()

0 commit comments

Comments
 (0)