Skip to content

Commit 4035baa

Browse files
Update additional functional tests
1 parent 8492003 commit 4035baa

16 files changed

+33
-20
lines changed

tests/functional/ext/private_import/private_import.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def c2_func() -> _TypeContainerC.C:
7979
# This is allowed since all the imports are used for typing
8080
from _TypeContainerExtra import TypeExtraA, TypeExtraB
8181
from MakerContainerExtra import GetA, GetB
82-
extraA: TypeExtraA = GetA()
83-
extraB: TypeExtraB = GetB()
82+
extra_a: TypeExtraA = GetA()
83+
extra_b: TypeExtraB = GetB()
8484

8585
# This is not allowed because there is an import not used for typing
8686
from _TypeContainerExtra2 import TypeExtra2, NotTypeExtra # [import-private-name]
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[MAIN]
22
load-plugins=pylint.extensions.private_import,
3+
const-naming-style=snake_case

tests/functional/f/function_redefined.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def callback2():
122122
return 24
123123
return callback1(), callback2()
124124

125-
do_something: Callable[[], int]
125+
do_something: Callable[[], int] # pylint: disable=invalid-name
126126

127127
def do_something() -> int:
128128
return 1

tests/functional/g/generic_alias/generic_alias_collections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class CustomImplementation(CustomAbstractCls2): # [abstract-method,abstract-met
110110
# Type annotations
111111
var_tuple: tuple[int, int]
112112
var_dict: dict[int, str]
113-
var_orderedDict: collections.OrderedDict[int, str]
113+
var_ordereddict: collections.OrderedDict[int, str]
114114
var_container: collections.abc.Container[int]
115115
var_sequence: collections.abc.Sequence[int]
116116
var_iterable: collections.abc.Iterable[int]
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[testoptions]
22
min_pyver=3.9
3+
4+
[MAIN]
5+
const-naming-style=snake_case
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[testoptions]
22
max_pyver=3.9
3+
4+
[MAIN]
5+
const-naming-style=snake_case
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[testoptions]
22
max_pyver=3.9
3+
4+
[MAIN]
5+
const-naming-style=snake_case

tests/functional/g/generic_alias/generic_alias_mixed_py39.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import typing
1010

1111
# Type annotations
12-
var_orderedDict: collections.OrderedDict[int, str]
12+
var_ordered_dict: collections.OrderedDict[int, str]
1313
var_container: collections.abc.Container[int]
1414
var_sequence: collections.abc.Sequence[int]
1515
var_iterable: collections.abc.Iterable[int]
1616
var_awaitable: collections.abc.Awaitable[int]
1717
var_pattern: re.Pattern[int]
1818
var_bytestring: collections.abc.ByteString
1919
var_hashable: collections.abc.Hashable
20-
var_ContextManager: contextlib.AbstractContextManager[int]
20+
var_context_manager: contextlib.AbstractContextManager[int]
2121

2222

2323
# No implementation required for 'builtins'
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[testoptions]
22
min_pyver=3.9
3+
4+
[MAIN]
5+
const-naming-style=snake_case

tests/functional/r/regression_02/regression_3979.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
else:
1111
BasePathLike = os.PathLike
1212

13-
Foo: Union[str, BasePathLike] = "bar"
13+
SOME_VAR: Union[str, BasePathLike] = "bar"

tests/functional/t/type/typealias_naming_style_default.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
# Regression tests
2929
# They are not TypeAlias, and thus shouldn't flag the message
30-
x: Union[str, int] = 42
31-
y: Union[str, int]
30+
X: Union[str, int] = 42
31+
Y: Union[str, int]
3232
# But the following, using a good TypeAlias name, is:
3333
GoodTypeAliasToUnion: TypeAlias = Union[str, int]
3434

tests/functional/u/unsubscriptable_value_py37.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ def __class_getitem__(cls, params):
1414
Subscriptable[0]
1515
Subscriptable()[0] # [unsubscriptable-object]
1616

17-
a: typing.List[int]
17+
A: typing.List[int]

tests/functional/u/unused/unused_import_py39.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
import typing as t
88

99

10-
example: t.Annotated[str, "Path"] = "/foo/bar"
10+
EXAMPLE: t.Annotated[str, "Path"] = "/foo/bar"

tests/functional/u/unused/unused_name_in_string_literal_type_annotation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import NoReturn, Set
99

1010
# unused-import shouldn't be emitted for Path
11-
example1: Set["Path"] = set()
11+
EXAMPLE1: Set["Path"] = set()
1212

1313
def example2(_: "ArgumentParser") -> "NoReturn":
1414
"""unused-import shouldn't be emitted for ArgumentParser or NoReturn."""
@@ -22,9 +22,9 @@ def example4(_: "PathLike[str]") -> None:
2222
"""unused-import shouldn't be emitted for PathLike."""
2323

2424
# pylint shouldn't crash with the following strings in a type annotation context
25-
example5: Set[""]
26-
example6: Set[" "]
27-
example7: Set["?"]
25+
EXAMPLE5: Set[""]
26+
EXAMPLE6: Set[" "]
27+
EXAMPLE7: Set["?"]
2828

2929
class Class:
3030
"""unused-import shouldn't be emitted for Namespace"""

tests/functional/u/unused/unused_name_in_string_literal_type_annotation_py38.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import Literal as Lit
99

1010
# str inside Literal shouldn't be treated as names
11-
example1: t.Literal["ArgumentParser", Lit["Namespace", "ArgumentParser"]]
11+
EXAMPLE1: t.Literal["ArgumentParser", Lit["Namespace", "ArgumentParser"]]
1212

1313

1414
def unused_variable_example():
@@ -19,9 +19,9 @@ def unused_variable_example():
1919

2020

2121
# pylint shouldn't crash with the following strings in a type annotation context
22-
example3: Lit["", " ", "?"] = "?"
22+
EXAMPLE3: Lit["", " ", "?"] = "?"
2323

2424

2525
# See https://peps.python.org/pep-0586/#literals-enums-and-forward-references
26-
example4: t.Literal["http.HTTPStatus.OK", "http.HTTPStatus.NOT_FOUND"]
27-
example5: "t.Literal[HTTPStatus.OK, HTTPStatus.NOT_FOUND]"
26+
EXAMPLE4: t.Literal["http.HTTPStatus.OK", "http.HTTPStatus.NOT_FOUND"]
27+
EXAMPLE5: "t.Literal[HTTPStatus.OK, HTTPStatus.NOT_FOUND]"

tests/input/func_noerror_cycle/b.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
if TYPE_CHECKING:
55
from .a import LstT
66

7-
var: "LstT" = [1, 2]
7+
VAR: "LstT" = [1, 2]

0 commit comments

Comments
 (0)