summaryrefslogtreecommitdiff
path: root/tests/config
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-04-22 22:56:12 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2022-04-26 09:08:23 +0200
commit8482d2ee74cdf96daffa1f32b8d04868d8c6c8e6 (patch)
treea92278d431f2265f37c87872a8535ebea876aa9b /tests/config
parentc17204d5298ca7a358be78f9b5f880db5f027d59 (diff)
downloadpylint-git-8482d2ee74cdf96daffa1f32b8d04868d8c6c8e6.tar.gz
Use an empty pylintrc for tests using project's pylintrc implicitely
We don't want to use the project's pylintrc during tests, because it means that a change in our config could break tests. But we want to see if the changes to the default break tests. Create a private '_Run' class in pylint.testutil._run Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/test_argparse_config.py4
-rw-r--r--tests/config/test_config.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/config/test_argparse_config.py b/tests/config/test_argparse_config.py
index 901bb5470..3bad5e8fa 100644
--- a/tests/config/test_argparse_config.py
+++ b/tests/config/test_argparse_config.py
@@ -11,7 +11,7 @@ import pytest
from pylint.config.arguments_manager import _ArgumentsManager
from pylint.config.exceptions import UnrecognizedArgumentAction
-from pylint.lint import Run
+from pylint.testutils._run import _Run as Run
HERE = abspath(dirname(__file__))
REGRTEST_DATA_DIR = join(HERE, "..", "regrtest_data")
@@ -64,7 +64,7 @@ class TestDeprecationOptions:
run = Run([EMPTY_MODULE, "--ignore=test,test_two"], exit=False)
assert run.linter.config.ignore == ["test", "test_two"]
assert run.linter.config.ignore == run.linter.config.black_list
- assert run.linter.config.ignore_patterns == [re.compile("^\\.#")]
+ assert run.linter.config.ignore_patterns == (re.compile("^\\.#"),)
assert run.linter.config.ignore_patterns == run.linter.config.black_list_re
diff --git a/tests/config/test_config.py b/tests/config/test_config.py
index 712d291ed..fefdb220d 100644
--- a/tests/config/test_config.py
+++ b/tests/config/test_config.py
@@ -11,7 +11,8 @@ import pytest
from pytest import CaptureFixture
from pylint.config.exceptions import _UnrecognizedOptionError
-from pylint.lint import Run
+from pylint.lint import Run as LintRun
+from pylint.testutils._run import _Run as Run
from pylint.testutils.configuration_test import run_using_a_configuration_file
HERE = Path(__file__).parent.absolute()
@@ -20,7 +21,7 @@ EMPTY_MODULE = REGRTEST_DATA_DIR / "empty.py"
def check_configuration_file_reader(
- runner: Run,
+ runner: LintRun,
expected_disabled: set[str] | None = None,
expected_jobs: int = 10,
expected_reports_truthey: bool = True,