-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix tests for Python 3.11 #7167
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
Conversation
Note, this is my first time touching pylint so please review carefully! There is still a problem with the |
Pull Request Test Coverage Report for Build 2666572139
π - Coveralls |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for a response on the CPython
issue. I'd like to know if this is a conscious decision.
tests/functional/a/access/access_attr_before_def_false_positive.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
I've re-factored the review changes into the original commits, and added a couple more fixes, including one for the syntax-error problem. In #6551 @DanielNoord suggested moving that test into the unit tests, but this just seems easier, at least until they change the description of this syntax error too... |
The CI failures look to be problems in the CI infra, not in the PR. |
@AdamWill Would you be willing to split out the |
@DanielNoord sure, I'll do that in a bit. |
This is because telnetlib is deprecated in Python 3.11. It's hard to see exactly what this is testing - there's no great explanation in-line and the test predates the first commit to the git repo so we don't have a commit message to help. telnetlib will be removed in 3.13, though, so at that point we'll have to figure it out or drop the telnetlib part of the test. Signed-off-by: Adam Williamson <[email protected]>
iterable_context_py3 includes some checks that we don't emit errors for asyncio.coroutine, but asyncio.coroutine has been removed in Python 3.11, so we need to set a max version of 3.10 for these tests. Signed-off-by: Adam Williamson <[email protected]>
The `binhex` module and `binascii.b2a_hqx()` function, which were deprecated in 3.9, are removed entirely in 3.11. Signed-off-by: Adam Williamson <[email protected]>
Python 3.11 changes the string representation of the SyntaxError triggered by this test - it now says "expected '('" instead of just "invalid syntax". This changes the test to use a different error (incomplete `for` loop) which still has just "invalid syntax" as its description in Python 3.11. This is the same 'bad code' used in the similar `test_stdin_syntaxerror` in the unit tests. Signed-off-by: Adam Williamson <[email protected]>
@DanielNoord done, can you clear the 'change requested'? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a mistake in my previous comment... π
Thanks @AdamWill
super-init-not-called
for Enum
subclassessuper-init-not-called
for Enum
subclasses~~
super-init-not-called
for Enum
subclasses~~
Type of Changes
Description
This fixes some issues in the tests with Python 3.11, and makes one change to the actual checks that is exposed by Python 3.11 - not emitting
super-init-not-called
for subclasses ofEnum
.Enum
has a__init__
in Python 3.11, but it does nothing at all (justpass
), and the examples in Python's ownEnum
docs include sample subclasses with their own__init__
which do not callEnum.__init__
, so clearly it's OK/intended for you to do that. I've asked upstream why this uselessEnum.__init__
was added at all.