diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-05 00:06:13 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-05 15:08:27 +0200 |
commit | fe7f36dfd7e67527392f37af6fd2c2b7738eb757 (patch) | |
tree | a3616266f273b7f6d43992b5365b439c83a42dcb | |
parent | f233db10166e96a55655ca2794428455ad9bf454 (diff) | |
download | pylint-git-fe7f36dfd7e67527392f37af6fd2c2b7738eb757.tar.gz |
Fix test failing if setup.py is not a launchable script
-rw-r--r-- | setup.py | 3 | ||||
-rw-r--r-- | tests/benchmark/test_baseline_benchmarks.py | 9 |
2 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,3 @@ from setuptools import setup -if __name__ == "__main__": - setup() +setup() diff --git a/tests/benchmark/test_baseline_benchmarks.py b/tests/benchmark/test_baseline_benchmarks.py index 6f79b1d7b..60ab96574 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -12,6 +12,7 @@ import os import pprint import time +from unittest.mock import patch import pytest @@ -340,9 +341,11 @@ class TestEstablishBaselineBenchmarks: linter = PyLinter() # Register all checkers/extensions and enable them - register_plugins( - linter, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) - ) + with patch("os.listdir", return_value=["pylint", "tests"]): + register_plugins( + linter, + os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")), + ) linter.load_default_plugins() linter.enable("all") |