Skip to content

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

Merged
merged 5 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pylint: disable=invalid-name,too-many-public-methods,attribute-defined-outside-init
# pylint: disable=useless-object-inheritance,too-few-public-methods
# pylint: disable=useless-object-inheritance,too-few-public-methods,deprecated-module
"""This module demonstrates a possible problem of pyLint with calling __init__ s
from inherited classes.
Initializations done there are not considered, which results in Error E0203 for
Expand Down
1 change: 1 addition & 0 deletions tests/functional/d/deprecated/deprecated_methods_py39.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[testoptions]
min_pyver=3.9
max_pyver=3.10
1 change: 1 addition & 0 deletions tests/functional/d/deprecated/deprecated_module_py39.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[testoptions]
min_pyver=3.9
max_pyver=3.10
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ py-version=3.8

[testoptions]
min_pyver=3.9
max_pyver=3.10
43 changes: 43 additions & 0 deletions tests/functional/i/iterable_context_asyncio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""
Checks that we don't erroneously emit not-an-iterable errors for
coroutines built with asyncio.coroutine.

These decorators were deprecated in 3.8 and removed in 3.10.
"""
# pylint: disable=missing-docstring,too-few-public-methods,unused-argument,bad-mcs-method-argument
# pylint: disable=wrong-import-position
import asyncio


@asyncio.coroutine
def coroutine_function_return_none():
return


@asyncio.coroutine
def coroutine_function_return_object():
return 12


@asyncio.coroutine
def coroutine_function_return_future():
return asyncio.Future()


@asyncio.coroutine
def coroutine_function_pass():
pass


@asyncio.coroutine
def coroutine_generator():
yield


@asyncio.coroutine
def main():
yield from coroutine_function_return_none()
yield from coroutine_function_return_object()
yield from coroutine_function_return_future()
yield from coroutine_function_pass()
yield from coroutine_generator()
2 changes: 2 additions & 0 deletions tests/functional/i/iterable_context_asyncio.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[testoptions]
max_pyver=3.10
37 changes: 0 additions & 37 deletions tests/functional/i/iterable_context_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,3 @@ class SomeClass(metaclass=Meta):
print(i)
for i in SomeClass(): # [not-an-iterable]
print(i)


import asyncio


@asyncio.coroutine
def coroutine_function_return_none():
return


@asyncio.coroutine
def coroutine_function_return_object():
return 12


@asyncio.coroutine
def coroutine_function_return_future():
return asyncio.Future()


@asyncio.coroutine
def coroutine_function_pass():
pass


@asyncio.coroutine
def coroutine_generator():
yield


@asyncio.coroutine
def main():
yield from coroutine_function_return_none()
yield from coroutine_function_return_object()
yield from coroutine_function_return_future()
yield from coroutine_function_pass()
yield from coroutine_generator()
2 changes: 1 addition & 1 deletion tests/functional/s/syntax/syntax_error.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
def toto # [syntax-error]
for # [syntax-error]
2 changes: 1 addition & 1 deletion tests/functional/s/syntax/syntax_error.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
syntax-error:1:10:None:None::invalid syntax (<unknown>, line 1):UNDEFINED
syntax-error:1:5:None:None::invalid syntax (<unknown>, line 1):UNDEFINED