diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-04-22 22:56:12 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-04-26 09:08:23 +0200 |
commit | 8482d2ee74cdf96daffa1f32b8d04868d8c6c8e6 (patch) | |
tree | a92278d431f2265f37c87872a8535ebea876aa9b /tests/benchmark | |
parent | c17204d5298ca7a358be78f9b5f880db5f027d59 (diff) | |
download | pylint-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/benchmark')
-rw-r--r-- | tests/benchmark/test_baseline_benchmarks.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/benchmark/test_baseline_benchmarks.py b/tests/benchmark/test_baseline_benchmarks.py index 5431fcf47..e96d58bbe 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -15,8 +15,9 @@ import pytest from astroid import nodes from pylint.checkers import BaseRawFileChecker -from pylint.lint import PyLinter, Run, check_parallel +from pylint.lint import PyLinter, check_parallel from pylint.testutils import GenericTestReporter as Reporter +from pylint.testutils._run import _Run as Run from pylint.typing import FileItem from pylint.utils import register_plugins @@ -302,14 +303,9 @@ class TestEstablishBaselineBenchmarks: ), f"Expected no errors to be thrown: {pprint.pformat(linter.reporter.messages)}" def test_baseline_benchmark_j1_all_checks_single_file(self, benchmark): - """Runs a single file, with -j1, against all plug-ins. - - ... that's the intent at least. - """ - # Just 1 file, but all Checkers/Extensions - fileinfos = [self.empty_filepath] - - runner = benchmark(Run, fileinfos, reporter=Reporter(), exit=False) + """Runs a single file, with -j1, against all checkers/Extensions.""" + args = [self.empty_filepath, "--enable=all", "--enable-all-extensions"] + runner = benchmark(Run, args, reporter=Reporter(), exit=False) assert runner.linter.config.jobs == 1 print("len(runner.linter._checkers)", len(runner.linter._checkers)) assert len(runner.linter._checkers) > 1, "Should have more than 'master'" |