-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DictStack: RecursionError: maximum recursion depth exceeded on pypy3 #7
Comments
That said, I can't figure out how to run doctests. Apparently the built-in doctest module gets confused and runs tests from the built-in $ pypy3 -m pytest --doctest-modules jaraco/collections.py
========================================================= test session starts =========================================================
platform linux -- Python 3.7.10[pypy-7.3.5-final], pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/jaraco.collections, configfile: pytest.ini
plugins: timeout-1.4.2, case-1.5.3, mock-3.6.1, localserver-0.5.0, expect-1.1.0, asyncio-0.15.1, forked-1.3.0, freezegun-0.4.2, metadata-1.8.0, requests-mock-1.9.3, subtests-0.5.0, betamax-0.8.1, pyfakefs-4.5.0, httpbin-1.0.0, shutil-1.7.0, virtualenv-1.7.0, xdist-2.3.0, cov-2.12.1, rerunfailures-10.1, flaky-3.7.0, xprocess-0.18.1, aiohttp-0.3.0, hypothesis-6.14.6
collected 0 items / 2 errors
=============================================================== ERRORS ================================================================
_______________________________________________ ERROR collecting jaraco/collections.py ________________________________________________
/usr/lib/pypy3.7/site-packages/_pytest/runner.py:311: in from_call
result: Optional[TResult] = func()
/usr/lib/pypy3.7/site-packages/_pytest/runner.py:341: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/pypy3.7/site-packages/_pytest/doctest.py:532: in collect
module = import_path(self.fspath)
/usr/lib/pypy3.7/site-packages/_pytest/pathlib.py:544: in import_path
raise ImportPathMismatchError(module_name, module_file, path)
E _pytest.pathlib.ImportPathMismatchError: ('collections', '/usr/lib/pypy3.7/lib-python/3/collections', PosixPath('/tmp/jaraco.collections/jaraco/collections.py'))
_______________________________________________ ERROR collecting jaraco/collections.py ________________________________________________
import file mismatch:
imported module 'collections' has this __file__ attribute:
/usr/lib/pypy3.7/lib-python/3/collections
which is not the same as the test file we want to collect:
/tmp/jaraco.collections/jaraco/collections.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
======================================================= short test summary info =======================================================
ERROR jaraco/collections.py - _pytest.pathlib.ImportPathMismatchError: ('collections', '/usr/lib/pypy3.7/lib-python/3/collections', ...
ERROR jaraco/collections.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================== 2 errors in 0.56s ========================================================== |
Ok, managed to run them via adding |
Fix DictStack RecursionError on PyPy3 via converting self to a list before iterating over it. Apparently, iterating over DictStack on PyPy3 causes it to call __getitem__, leading to infinite recursion. Fixes jaraco#7
This issue seems to be the same one causing the latest version of setuptools to fail the CI checks: https://github.com/pypa/setuptools/runs/4693827902?check_suite_focus=true |
This seems to have been solved in the latest version.... |
Yes, there's a known issue in pytest that it can't test modules in an implicit namespace if the module name matches another module. Maybe pytest-dev/pytest#8059 or one of the related issues. It means that many of the |
Unfortunately, I don't have PyPy on my platform (macOS on ARM with homebrew), so I'm unable to test the issue. It does look like the issue was addressed in 9d39238. |
You can always add it to GHA test matrix. PyPy is surprisingly well supported, with all alphas and betas getting early support (and no fancy 'alpha' required like in cpython), i.e. right now |
title of this issue 🙈 |
Fixed now. You gotta ask Freud about this typo. |
I'll submit a dumb-ish PR shortly.
The text was updated successfully, but these errors were encountered: