Skip to content

Commit ff8cdd2

Browse files
[test] Use an empty pylintrc so tests to not depend on system's conf (#8350) (#8351)
* [test] Use an empty pylintrc so tests to not depend on system's conf Closes #8342 * Update tests/checkers/unittest_imports.py Co-authored-by: Daniël van Noord <[email protected]> --------- Co-authored-by: Daniël van Noord <[email protected]> (cherry picked from commit 641f526) Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent e734d56 commit ff8cdd2

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

tests/checkers/unittest_imports.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
from pylint.checkers import imports
1313
from pylint.interfaces import UNDEFINED
14-
from pylint.lint import Run
1514
from pylint.testutils import CheckerTestCase, MessageTest
15+
from pylint.testutils._run import _Run as Run
1616

1717
REGR_DATA = os.path.join(os.path.dirname(__file__), "..", "regrtest_data", "")
1818

@@ -152,7 +152,7 @@ def test_allow_reexport_package(capsys: CaptureFixture[str]) -> None:
152152
exit=False,
153153
)
154154
output, errors = capsys.readouterr()
155-
assert len(output.split("\n")) == 5, f"Expected 5 line breaks in:{output}"
155+
assert len(output.split("\n")) == 7, f"Expected 7 line breaks in:{output}"
156156
assert (
157157
"__init__.py:1:0: C0414: Import alias does not rename original package (useless-import-alias)"
158158
in output
@@ -168,6 +168,7 @@ def test_allow_reexport_package(capsys: CaptureFixture[str]) -> None:
168168
[
169169
f"{os.path.join(REGR_DATA, 'allow_reexport')}",
170170
"--allow-reexport-from-package=yes",
171+
"--disable=missing-module-docstring",
171172
"-sn",
172173
],
173174
exit=False,

tests/config/pylint_config/test_pylint_config_generate.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,15 @@ def test_writing_minimal_file(
186186
assert any(line.startswith("#") for line in captured.out.splitlines())
187187

188188
# Check minimal doesn't have comments and no default values
189-
Run(["--accept-no-return-doc=y", "generate", "--interactive"], exit=False)
189+
Run(
190+
[
191+
"--load-plugins=pylint.extensions.docparams",
192+
"--accept-no-return-doc=y",
193+
"generate",
194+
"--interactive",
195+
],
196+
exit=False,
197+
)
190198
captured = capsys.readouterr()
191199
assert not any(i.startswith("#") for i in captured.out.split("\n"))
192200
assert "accept-no-return-doc" not in captured.out

tests/config/test_per_directory_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from pathlib import Path
66

7-
from pylint.lint import Run
7+
from pylint.testutils._run import _Run as Run
88

99

1010
def test_fall_back_on_base_config(tmp_path: Path) -> None:

tests/test_pylint_runners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import pytest
1919

2020
from pylint import run_epylint, run_pylint, run_pyreverse, run_symilar
21-
from pylint.lint import Run
2221
from pylint.testutils import GenericTestReporter as Reporter
22+
from pylint.testutils._run import _Run as Run
2323
from pylint.testutils.utils import _test_cwd
2424

2525
if sys.version_info >= (3, 8):

0 commit comments

Comments
 (0)