diff --git a/Tests/t_ldapobject.py b/Tests/t_ldapobject.py index ccc7d218..c26b317c 100644 --- a/Tests/t_ldapobject.py +++ b/Tests/t_ldapobject.py @@ -657,7 +657,11 @@ def _open_ldap_conn(self, who=None, cred=None, **kwargs): ) def tearDown(self): - self._sock.close() + try: + self._sock.close() + except OSError: + # PyPy sometimes fails with "Bad file descriptor" + pass delattr(self, '_sock') super().tearDown() diff --git a/tox.ini b/tox.ini index beade024..5907fbca 100644 --- a/tox.ini +++ b/tox.ini @@ -86,8 +86,8 @@ commands = Tests/t_ldif.py \ Tests/t_untested_mods.py -[testenv:pypy3] -basepython = pypy3 +[testenv:pypy3.9] +basepython = pypy3.9 deps = pytest commands = {envpython} -m pytest {posargs}