Skip to content

Commit

Permalink
[pypy3.8] Disable multiple-statements false positive on affected func…
Browse files Browse the repository at this point in the history
…tional tests
  • Loading branch information
Pierre-Sassoulas committed Dec 15, 2022
1 parent dca3940 commit 5a4af8b
Show file tree
Hide file tree
Showing 36 changed files with 339 additions and 231 deletions.
4 changes: 3 additions & 1 deletion tests/functional/a/alternative/alternative_union_syntax.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Test PEP 604 - Alternative Union syntax"""

# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring
# pylint: disable=inherit-non-class,too-few-public-methods,unnecessary-direct-lambda-call
# pylint: disable=inherit-non-class,too-few-public-methods,unnecessary-direct-lambda-call,superfluous-parens

import dataclasses
import typing
from dataclasses import dataclass
Expand Down
14 changes: 11 additions & 3 deletions tests/functional/a/alternative/alternative_union_syntax_error.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
"""Test PEP 604 - Alternative Union syntax
without postponed evaluation of annotations.
"""Test PEP 604 - Alternative Union syntax with postponed evaluation of
annotations enabled.
For Python 3.7 - 3.9: Everything should fail.
Testing only 3.8/3.9 to support TypedDict.
"""
# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring,inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call,unnecessary-lambda-assignment

# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring
# pylint: disable=inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call
# pylint: disable=unnecessary-lambda-assignment

# Disabled because of a bug with pypy 3.8 see
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
# pylint: disable=multiple-statements

import dataclasses
import typing
from dataclasses import dataclass
Expand Down
52 changes: 26 additions & 26 deletions tests/functional/a/alternative/alternative_union_syntax_error.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
unsupported-binary-operation:14:8:14:30::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:15:7:15:35::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:17:23:17:33::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:18:6:18:22::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:18:6:18:15::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:19:6:19:34::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:20:18:20:46::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:23:23:23:32::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:25:24:25:33::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:27:14:27:23::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:29:5:29:14::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:31:14:31:23:func:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:34:15:34:24:func2:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:40:9:40:25::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:47:36:47:45::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:50:12:50:21:CustomNamedTuple2:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:53:12:53:21:CustomNamedTuple3:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:57:54:57:63::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:59:60:59:69::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:62:12:62:21:CustomTypedDict3:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:65:12:65:21:CustomTypedDict4:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:76:12:76:21:CustomDataClass:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:80:12:80:21:CustomDataClass2:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:84:12:84:21:CustomDataClass3:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:89:12:89:21:CustomDataClass4:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:111:31:111:61::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:22:8:22:30::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:23:7:23:35::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:25:23:25:33::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:26:6:26:22::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:26:6:26:15::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:27:6:27:34::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:28:18:28:46::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:31:23:31:32::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:33:24:33:33::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:35:14:35:23::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:37:5:37:14::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:39:14:39:23:func:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:42:15:42:24:func2:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:48:9:48:25::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:55:36:55:45::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:58:12:58:21:CustomNamedTuple2:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:61:12:61:21:CustomNamedTuple3:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:65:54:65:63::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:67:60:67:69::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:70:12:70:21:CustomTypedDict3:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:73:12:73:21:CustomTypedDict4:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:84:12:84:21:CustomDataClass:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:88:12:88:21:CustomDataClass2:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:92:12:92:21:CustomDataClass3:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:97:12:97:21:CustomDataClass4:unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:119:31:119:61::unsupported operand type(s) for |:INFERENCE
13 changes: 10 additions & 3 deletions tests/functional/a/alternative/alternative_union_syntax_py37.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
"""Test PEP 604 - Alternative Union syntax
with postponed evaluation of annotations enabled.
"""Test PEP 604 - Alternative Union syntax with postponed evaluation of
annotations enabled.
For Python 3.7 - 3.9: Most things should work.
Testing only 3.8/3.9 to support TypedDict.
"""
# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring,inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call

# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring
# pylint: disable=inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call

# Disabled because of a bug with pypy 3.8 see
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
# pylint: disable=multiple-statements

from __future__ import annotations
import dataclasses
import typing
Expand Down
18 changes: 9 additions & 9 deletions tests/functional/a/alternative/alternative_union_syntax_py37.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
unsupported-binary-operation:15:8:15:30::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:16:7:16:35::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:24:23:24:32::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:26:24:26:33::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:28:14:28:23::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:41:9:41:25::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:48:36:48:45::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:58:54:58:63::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:60:60:60:69::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:22:8:22:30::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:23:7:23:35::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:31:23:31:32::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:33:24:33:33::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:35:14:35:23::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:48:9:48:25::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:55:36:55:45::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:65:54:65:63::unsupported operand type(s) for |:INFERENCE
unsupported-binary-operation:67:60:67:69::unsupported operand type(s) for |:INFERENCE
6 changes: 6 additions & 0 deletions tests/functional/ext/typing/typing_consider_using_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
'py-version' needs to be set to '3.7' or '3.8' and 'runtime-typing=no'.
With 'from __future__ import annotations' present.
"""

# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unnecessary-direct-lambda-call

# Disabled because of a bug with pypy 3.8 see
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
# pylint: disable=multiple-statements

from __future__ import annotations

import collections
Expand Down
40 changes: 20 additions & 20 deletions tests/functional/ext/typing/typing_consider_using_alias.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
consider-using-alias:16:6:16:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
consider-using-alias:17:6:17:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:19:6:19:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE
consider-using-alias:20:6:20:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE
consider-using-alias:21:6:21:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE
consider-using-alias:22:6:22:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE
consider-using-alias:23:6:23:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE
consider-using-alias:24:6:24:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE
consider-using-alias:25:7:25:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE
consider-using-alias:34:9:34:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:36:7:36:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE
consider-using-alias:37:7:37:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
consider-using-alias:38:7:38:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE
consider-using-alias:44:74:44:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
consider-using-alias:44:16:44:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:44:37:44:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:44:93:44:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
consider-using-alias:60:12:60:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:65:12:65:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:69:12:69:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:22:6:22:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
consider-using-alias:23:6:23:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:25:6:25:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE
consider-using-alias:26:6:26:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE
consider-using-alias:27:6:27:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE
consider-using-alias:28:6:28:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE
consider-using-alias:29:6:29:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE
consider-using-alias:30:6:30:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE
consider-using-alias:31:7:31:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE
consider-using-alias:40:9:40:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:42:7:42:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE
consider-using-alias:43:7:43:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
consider-using-alias:44:7:44:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE
consider-using-alias:50:74:50:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
consider-using-alias:50:16:50:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:50:37:50:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:50:93:50:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
consider-using-alias:66:12:66:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:71:12:71:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
consider-using-alias:75:12:75:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
'py-version' needs to be set to '3.7' or '3.8' and 'runtime-typing=no'.
"""
# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unsubscriptable-object,unnecessary-direct-lambda-call

# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unsubscriptable-object
# pylint: disable=unnecessary-direct-lambda-call

# Disabled because of a bug with pypy 3.8 see
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
# pylint: disable=multiple-statements

import collections
import collections.abc
import typing
Expand Down

0 comments on commit 5a4af8b

Please sign in to comment.