Skip to content

Commit 3c3ab98

Browse files
[pypy3.8] Disable multiple-statements false positive on affected functional tests
1 parent dca3940 commit 3c3ab98

38 files changed

+356
-243
lines changed

tests/functional/a/alternative/alternative_union_syntax.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Test PEP 604 - Alternative Union syntax"""
2+
23
# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring
3-
# pylint: disable=inherit-non-class,too-few-public-methods,unnecessary-direct-lambda-call
4+
# pylint: disable=inherit-non-class,too-few-public-methods,unnecessary-direct-lambda-call,superfluous-parens
5+
46
import dataclasses
57
import typing
68
from dataclasses import dataclass

tests/functional/a/alternative/alternative_union_syntax_error.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
"""Test PEP 604 - Alternative Union syntax
2-
without postponed evaluation of annotations.
1+
"""Test PEP 604 - Alternative Union syntax with postponed evaluation of
2+
annotations enabled.
33
44
For Python 3.7 - 3.9: Everything should fail.
55
Testing only 3.8/3.9 to support TypedDict.
66
"""
7-
# 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
7+
8+
# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring
9+
# pylint: disable=inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call
10+
# pylint: disable=unnecessary-lambda-assignment
11+
12+
# Disabled because of a bug with pypy 3.8 see
13+
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
14+
# pylint: disable=multiple-statements
15+
816
import dataclasses
917
import typing
1018
from dataclasses import dataclass
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
unsupported-binary-operation:14:8:14:30::unsupported operand type(s) for |:INFERENCE
2-
unsupported-binary-operation:15:7:15:35::unsupported operand type(s) for |:INFERENCE
3-
unsupported-binary-operation:17:23:17:33::unsupported operand type(s) for |:INFERENCE
4-
unsupported-binary-operation:18:6:18:22::unsupported operand type(s) for |:INFERENCE
5-
unsupported-binary-operation:18:6:18:15::unsupported operand type(s) for |:INFERENCE
6-
unsupported-binary-operation:19:6:19:34::unsupported operand type(s) for |:INFERENCE
7-
unsupported-binary-operation:20:18:20:46::unsupported operand type(s) for |:INFERENCE
8-
unsupported-binary-operation:23:23:23:32::unsupported operand type(s) for |:INFERENCE
9-
unsupported-binary-operation:25:24:25:33::unsupported operand type(s) for |:INFERENCE
10-
unsupported-binary-operation:27:14:27:23::unsupported operand type(s) for |:INFERENCE
11-
unsupported-binary-operation:29:5:29:14::unsupported operand type(s) for |:INFERENCE
12-
unsupported-binary-operation:31:14:31:23:func:unsupported operand type(s) for |:INFERENCE
13-
unsupported-binary-operation:34:15:34:24:func2:unsupported operand type(s) for |:INFERENCE
14-
unsupported-binary-operation:40:9:40:25::unsupported operand type(s) for |:INFERENCE
15-
unsupported-binary-operation:47:36:47:45::unsupported operand type(s) for |:INFERENCE
16-
unsupported-binary-operation:50:12:50:21:CustomNamedTuple2:unsupported operand type(s) for |:INFERENCE
17-
unsupported-binary-operation:53:12:53:21:CustomNamedTuple3:unsupported operand type(s) for |:INFERENCE
18-
unsupported-binary-operation:57:54:57:63::unsupported operand type(s) for |:INFERENCE
19-
unsupported-binary-operation:59:60:59:69::unsupported operand type(s) for |:INFERENCE
20-
unsupported-binary-operation:62:12:62:21:CustomTypedDict3:unsupported operand type(s) for |:INFERENCE
21-
unsupported-binary-operation:65:12:65:21:CustomTypedDict4:unsupported operand type(s) for |:INFERENCE
22-
unsupported-binary-operation:76:12:76:21:CustomDataClass:unsupported operand type(s) for |:INFERENCE
23-
unsupported-binary-operation:80:12:80:21:CustomDataClass2:unsupported operand type(s) for |:INFERENCE
24-
unsupported-binary-operation:84:12:84:21:CustomDataClass3:unsupported operand type(s) for |:INFERENCE
25-
unsupported-binary-operation:89:12:89:21:CustomDataClass4:unsupported operand type(s) for |:INFERENCE
26-
unsupported-binary-operation:111:31:111:61::unsupported operand type(s) for |:INFERENCE
1+
unsupported-binary-operation:22:8:22:30::unsupported operand type(s) for |:INFERENCE
2+
unsupported-binary-operation:23:7:23:35::unsupported operand type(s) for |:INFERENCE
3+
unsupported-binary-operation:25:23:25:33::unsupported operand type(s) for |:INFERENCE
4+
unsupported-binary-operation:26:6:26:22::unsupported operand type(s) for |:INFERENCE
5+
unsupported-binary-operation:26:6:26:15::unsupported operand type(s) for |:INFERENCE
6+
unsupported-binary-operation:27:6:27:34::unsupported operand type(s) for |:INFERENCE
7+
unsupported-binary-operation:28:18:28:46::unsupported operand type(s) for |:INFERENCE
8+
unsupported-binary-operation:31:23:31:32::unsupported operand type(s) for |:INFERENCE
9+
unsupported-binary-operation:33:24:33:33::unsupported operand type(s) for |:INFERENCE
10+
unsupported-binary-operation:35:14:35:23::unsupported operand type(s) for |:INFERENCE
11+
unsupported-binary-operation:37:5:37:14::unsupported operand type(s) for |:INFERENCE
12+
unsupported-binary-operation:39:14:39:23:func:unsupported operand type(s) for |:INFERENCE
13+
unsupported-binary-operation:42:15:42:24:func2:unsupported operand type(s) for |:INFERENCE
14+
unsupported-binary-operation:48:9:48:25::unsupported operand type(s) for |:INFERENCE
15+
unsupported-binary-operation:55:36:55:45::unsupported operand type(s) for |:INFERENCE
16+
unsupported-binary-operation:58:12:58:21:CustomNamedTuple2:unsupported operand type(s) for |:INFERENCE
17+
unsupported-binary-operation:61:12:61:21:CustomNamedTuple3:unsupported operand type(s) for |:INFERENCE
18+
unsupported-binary-operation:65:54:65:63::unsupported operand type(s) for |:INFERENCE
19+
unsupported-binary-operation:67:60:67:69::unsupported operand type(s) for |:INFERENCE
20+
unsupported-binary-operation:70:12:70:21:CustomTypedDict3:unsupported operand type(s) for |:INFERENCE
21+
unsupported-binary-operation:73:12:73:21:CustomTypedDict4:unsupported operand type(s) for |:INFERENCE
22+
unsupported-binary-operation:84:12:84:21:CustomDataClass:unsupported operand type(s) for |:INFERENCE
23+
unsupported-binary-operation:88:12:88:21:CustomDataClass2:unsupported operand type(s) for |:INFERENCE
24+
unsupported-binary-operation:92:12:92:21:CustomDataClass3:unsupported operand type(s) for |:INFERENCE
25+
unsupported-binary-operation:97:12:97:21:CustomDataClass4:unsupported operand type(s) for |:INFERENCE
26+
unsupported-binary-operation:119:31:119:61::unsupported operand type(s) for |:INFERENCE

tests/functional/a/alternative/alternative_union_syntax_py37.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
"""Test PEP 604 - Alternative Union syntax
2-
with postponed evaluation of annotations enabled.
1+
"""Test PEP 604 - Alternative Union syntax with postponed evaluation of
2+
annotations enabled.
33
44
For Python 3.7 - 3.9: Most things should work.
55
Testing only 3.8/3.9 to support TypedDict.
66
"""
7-
# 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
7+
8+
# pylint: disable=missing-function-docstring,unused-argument,invalid-name,missing-class-docstring
9+
# pylint: disable=inherit-non-class,too-few-public-methods,line-too-long,unnecessary-direct-lambda-call
10+
11+
# Disabled because of a bug with pypy 3.8 see
12+
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
13+
# pylint: disable=multiple-statements
14+
815
from __future__ import annotations
916
import dataclasses
1017
import typing
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
unsupported-binary-operation:15:8:15:30::unsupported operand type(s) for |:INFERENCE
2-
unsupported-binary-operation:16:7:16:35::unsupported operand type(s) for |:INFERENCE
3-
unsupported-binary-operation:24:23:24:32::unsupported operand type(s) for |:INFERENCE
4-
unsupported-binary-operation:26:24:26:33::unsupported operand type(s) for |:INFERENCE
5-
unsupported-binary-operation:28:14:28:23::unsupported operand type(s) for |:INFERENCE
6-
unsupported-binary-operation:41:9:41:25::unsupported operand type(s) for |:INFERENCE
7-
unsupported-binary-operation:48:36:48:45::unsupported operand type(s) for |:INFERENCE
8-
unsupported-binary-operation:58:54:58:63::unsupported operand type(s) for |:INFERENCE
9-
unsupported-binary-operation:60:60:60:69::unsupported operand type(s) for |:INFERENCE
1+
unsupported-binary-operation:22:8:22:30::unsupported operand type(s) for |:INFERENCE
2+
unsupported-binary-operation:23:7:23:35::unsupported operand type(s) for |:INFERENCE
3+
unsupported-binary-operation:31:23:31:32::unsupported operand type(s) for |:INFERENCE
4+
unsupported-binary-operation:33:24:33:33::unsupported operand type(s) for |:INFERENCE
5+
unsupported-binary-operation:35:14:35:23::unsupported operand type(s) for |:INFERENCE
6+
unsupported-binary-operation:48:9:48:25::unsupported operand type(s) for |:INFERENCE
7+
unsupported-binary-operation:55:36:55:45::unsupported operand type(s) for |:INFERENCE
8+
unsupported-binary-operation:65:54:65:63::unsupported operand type(s) for |:INFERENCE
9+
unsupported-binary-operation:67:60:67:69::unsupported operand type(s) for |:INFERENCE

tests/functional/d/dataclass_typecheck.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Tests for regressions from https://github.com/PyCQA/astroid/pull/1126
44
"""
55
# pylint: disable=missing-docstring,too-few-public-methods,pointless-statement,redefined-builtin, fixme
6+
7+
# Disabled because of a bug with pypy 3.8 see
8+
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
9+
# pylint: disable=multiple-statements
10+
611
from dataclasses import dataclass
712
from typing import Callable, Dict, List, Optional
813

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
invalid-sequence-index:32:6:32:20::Sequence index is not an int, slice, or instance with __index__:UNDEFINED
2-
invalid-slice-index:36:10:36:19::Slice index is not an int, None, or instance with __index__:UNDEFINED
3-
not-callable:39:0:39:14::obj.attr1 is not callable:UNDEFINED
4-
invalid-unary-operand-type:44:6:44:16::"bad operand type for unary -: str":UNDEFINED
5-
unsupported-membership-test:51:11:51:20::Value 'obj.attr1' doesn't support membership test:UNDEFINED
6-
unsubscriptable-object:56:6:56:15::Value 'obj.attr1' is unsubscriptable:UNDEFINED
7-
unsupported-assignment-operation:61:0:61:9::'obj.attr1' does not support item assignment:UNDEFINED
8-
unsupported-delete-operation:66:4:66:13::'obj.attr1' does not support item deletion:UNDEFINED
9-
not-context-manager:91:0:92:8::Context manager 'str' doesn't implement __enter__ and __exit__.:UNDEFINED
10-
invalid-metaclass:99:0:99:11:Test2:Invalid metaclass 'Instance of builtins.int' used:UNDEFINED
11-
unhashable-member:105:0:105:2::'obj.attr5' is unhashable and can't be used as a key in a dict:INFERENCE
12-
isinstance-second-argument-not-valid-type:115:6:115:30::Second argument of isinstance is not a type:UNDEFINED
1+
invalid-sequence-index:37:6:37:20::Sequence index is not an int, slice, or instance with __index__:UNDEFINED
2+
invalid-slice-index:41:10:41:19::Slice index is not an int, None, or instance with __index__:UNDEFINED
3+
not-callable:44:0:44:14::obj.attr1 is not callable:UNDEFINED
4+
invalid-unary-operand-type:49:6:49:16::"bad operand type for unary -: str":UNDEFINED
5+
unsupported-membership-test:56:11:56:20::Value 'obj.attr1' doesn't support membership test:UNDEFINED
6+
unsubscriptable-object:61:6:61:15::Value 'obj.attr1' is unsubscriptable:UNDEFINED
7+
unsupported-assignment-operation:66:0:66:9::'obj.attr1' does not support item assignment:UNDEFINED
8+
unsupported-delete-operation:71:4:71:13::'obj.attr1' does not support item deletion:UNDEFINED
9+
not-context-manager:96:0:97:8::Context manager 'str' doesn't implement __enter__ and __exit__.:UNDEFINED
10+
invalid-metaclass:104:0:104:11:Test2:Invalid metaclass 'Instance of builtins.int' used:UNDEFINED
11+
unhashable-member:110:0:110:2::'obj.attr5' is unhashable and can't be used as a key in a dict:INFERENCE
12+
isinstance-second-argument-not-valid-type:120:6:120:30::Second argument of isinstance is not a type:UNDEFINED

tests/functional/ext/typing/typing_consider_using_alias.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
'py-version' needs to be set to '3.7' or '3.8' and 'runtime-typing=no'.
44
With 'from __future__ import annotations' present.
55
"""
6+
67
# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unnecessary-direct-lambda-call
8+
9+
# Disabled because of a bug with pypy 3.8 see
10+
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
11+
# pylint: disable=multiple-statements
12+
713
from __future__ import annotations
814

915
import collections
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
consider-using-alias:16:6:16:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
2-
consider-using-alias:17:6:17:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
3-
consider-using-alias:19:6:19:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE
4-
consider-using-alias:20:6:20:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE
5-
consider-using-alias:21:6:21:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE
6-
consider-using-alias:22:6:22:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE
7-
consider-using-alias:23:6:23:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE
8-
consider-using-alias:24:6:24:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE
9-
consider-using-alias:25:7:25:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE
10-
consider-using-alias:34:9:34:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
11-
consider-using-alias:36:7:36:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE
12-
consider-using-alias:37:7:37:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
13-
consider-using-alias:38:7:38:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE
14-
consider-using-alias:44:74:44:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
15-
consider-using-alias:44:16:44:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
16-
consider-using-alias:44:37:44:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
17-
consider-using-alias:44:93:44:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
18-
consider-using-alias:60:12:60:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
19-
consider-using-alias:65:12:65:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
20-
consider-using-alias:69:12:69:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
1+
consider-using-alias:22:6:22:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
2+
consider-using-alias:23:6:23:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
3+
consider-using-alias:25:6:25:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE
4+
consider-using-alias:26:6:26:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE
5+
consider-using-alias:27:6:27:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE
6+
consider-using-alias:28:6:28:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE
7+
consider-using-alias:29:6:29:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE
8+
consider-using-alias:30:6:30:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE
9+
consider-using-alias:31:7:31:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE
10+
consider-using-alias:40:9:40:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
11+
consider-using-alias:42:7:42:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE
12+
consider-using-alias:43:7:43:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
13+
consider-using-alias:44:7:44:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE
14+
consider-using-alias:50:74:50:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE
15+
consider-using-alias:50:16:50:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
16+
consider-using-alias:50:37:50:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
17+
consider-using-alias:50:93:50:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE
18+
consider-using-alias:66:12:66:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
19+
consider-using-alias:71:12:71:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE
20+
consider-using-alias:75:12:75:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE

tests/functional/ext/typing/typing_consider_using_alias_without_future.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
33
'py-version' needs to be set to '3.7' or '3.8' and 'runtime-typing=no'.
44
"""
5-
# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unsubscriptable-object,unnecessary-direct-lambda-call
5+
6+
# pylint: disable=missing-docstring,invalid-name,unused-argument,line-too-long,unsubscriptable-object
7+
# pylint: disable=unnecessary-direct-lambda-call
8+
9+
# Disabled because of a bug with pypy 3.8 see
10+
# https://github.com/PyCQA/pylint/pull/7918#issuecomment-1352737369
11+
# pylint: disable=multiple-statements
12+
613
import collections
714
import collections.abc
815
import typing

0 commit comments

Comments
 (0)