Skip to content

Commit

Permalink
Skip test on PyPy 3.8 and 3.9.
Browse files Browse the repository at this point in the history
Fails in the latest PyPy release, with both UserList and an ordinary list.
  • Loading branch information
domdfcoding committed Dec 19, 2022
1 parent 1fe24c8 commit 9f5044d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/seq_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import pickle
import sys
from itertools import chain
from typing import List
from typing import Any, List

# 3rd party
import pytest
from coincidence.selectors import not_pypy

# this package
from domdf_python_tools.compat import PYPY38_PLUS
from domdf_python_tools.iterative import Len


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

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

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

assert a.count(ALWAYS_EQ), 9
assert self.type2test([ALWAYS_EQ, ALWAYS_EQ]).count(1) == 2
assert self.type2test([ALWAYS_EQ, ALWAYS_EQ]).count(NEVER_EQ) == 2
assert self.type2test([NEVER_EQ, NEVER_EQ]).count(ALWAYS_EQ) == 0

if not PYPY38_PLUS: # TODO: figure out why the tests fail
assert self.type2test([ALWAYS_EQ, ALWAYS_EQ]).count(NEVER_EQ) == 2
assert self.type2test([NEVER_EQ, NEVER_EQ]).count(ALWAYS_EQ) == 0

with pytest.raises(TypeError):
a.count()
Expand Down

0 comments on commit 9f5044d

Please sign in to comment.