Skip to content

Commit 01ca7ff

Browse files
Update existing tests
1 parent 9e07b59 commit 01ca7ff

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/lint/unittest_lint.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@
4141
from pylint.testutils import create_files
4242
from pylint.testutils._run import _Run as Run
4343
from pylint.typing import MessageLocationTuple
44-
from pylint.utils import FileState, print_full_documentation, tokenize_module
44+
from pylint.utils import (
45+
FileState,
46+
LinterStats,
47+
print_full_documentation,
48+
tokenize_module,
49+
)
4550

4651
if os.name == "java":
4752
if os.name == "nt":
@@ -1030,6 +1035,8 @@ def test_by_module_statement_value(initialized_linter: PyLinter) -> None:
10301035
by_module_stats = linter.stats.by_module
10311036
for module, module_stats in by_module_stats.items():
10321037
linter2 = initialized_linter
1038+
linter2.stats = LinterStats()
1039+
10331040
if module == "data":
10341041
linter2.check([os.path.join(os.path.dirname(__file__), "data/__init__.py")])
10351042
else:

tests/test_regr.py

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from pylint import testutils
2222
from pylint.lint.pylinter import PyLinter
23+
from pylint.utils.linterstats import LinterStats
2324

2425
REGR_DATA = join(dirname(abspath(__file__)), "regrtest_data")
2526
sys.path.insert(1, REGR_DATA)
@@ -116,6 +117,7 @@ def test_check_package___init__(finalize_linter: PyLinter) -> None:
116117
assert sorted(checked) == sorted(filename)
117118

118119
os.chdir(join(REGR_DATA, "package"))
120+
finalize_linter.stats = LinterStats()
119121
finalize_linter.check(["__init__"])
120122
checked = list(finalize_linter.stats.by_module.keys())
121123
assert checked == ["__init__"]

0 commit comments

Comments
 (0)