-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Some Python 3.12 test errors #21688
Comments
Oh dear, I tried patching the
The first small thing to observe is that the
It turns out that this test has multiple errors in it, which appear once |
A final test that fails, which I missed earlier is
It works fine with Python 3.11, but with Python 3.12, although the line wanted is present, for some reason, |
So with the pull requests accepted, the only remaining newly failing test is, I think, |
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
There are some test suite errors with Python 3.12 (and possibly more recent versions of some related modules) with Spyder 5.5.0.
spyder/plugins/editor/widgets/tests/test_warnings.py::test_update_warnings_after_closequotes
(now moved tospyder/plugins/editor/widgets/codeeditor/tests/test_warnings.py
in the master branch)This fails with the error:
With Python 3.12, pycodestyle returns the message
1:8: E901 TokenError: unterminated string literal (detected at line 1)
whereas with Python 3.11, it gives no output. I could patch this test by allowing the second result string, but it may be that it is necessary to change the editor warning code to avoid having a duplicated warning. (I haven't checked this yet - I'm still running Spyder under Python 3.11, but I could if you'd like me to.)spyder/plugins/editor/widgets/tests/test_warnings.py::test_update_warnings_after_closebrackets
This fails with the error:
Running pycodestyle with the two Python versions shows the cause:
Python 3.11:
/tmp/pycodestyle_test2.py:2:1: E901 TokenError: EOF in multi-line statement
Python 3.12:
/tmp/pycodestyle_test2.py:1:1: E901 TokenError: unexpected EOF in multi-line statement
spyder/plugins/editor/tests/test_plugin.py::test_renamed_tree
andspyder/plugins/editor/tests/test_plugin.py::test_report_issue_url
The first fails with the error
and the second with a similar error; this is because
called_with
should beassert_called_with
; there are five occurrences of this in the codebase:Perhaps
pytest-mock
has got a bit stricter recently or this is a Python 3.12 change inunittest.mock
? Anyway, this is easy to fix.spyder/plugins/variableexplorer/widgets/objectexplorer/tests/test_objectexplorer.py::test_objectexplorer_collection_types[params4]
This seems like a minor update is needed for Python 3.12:
Versions
The text was updated successfully, but these errors were encountered: