14
0
forked from pool/python-pylint
Files
python-pylint/pylint-pr4450-import-init.patch

48 lines
1.6 KiB
Diff

From 4ad9037c5e2fde8f598ad92b24d07cb7abac6c2b Mon Sep 17 00:00:00 2001
From: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date: Fri, 7 May 2021 14:45:42 +0200
Subject: [PATCH] Fix broken tests
---
tests/test_self.py | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/tests/test_self.py b/tests/test_self.py
index 55cfbbc827..7f26ddeb3a 100644
--- a/tests/test_self.py
+++ b/tests/test_self.py
@@ -1077,20 +1077,24 @@ def test_allow_import_of_files_found_in_modules_during_parallel_check(self, tmpd
code=0,
)
- def test_can_list_directories_without_dunder_init(self, tmpdir):
+ @staticmethod
+ def test_can_list_directories_without_dunder_init(tmpdir):
test_directory = tmpdir / "test_directory"
test_directory.mkdir()
spam_module = test_directory / "spam.py"
spam_module.write("'Empty'")
- with tmpdir.as_cwd():
- self._runtest(
- [
- "--disable=missing-docstring, missing-final-newline",
- "test_directory",
- ],
- code=0,
- )
+ subprocess.check_output(
+ [
+ sys.executable,
+ "-m",
+ "pylint",
+ "--disable=missing-docstring, missing-final-newline",
+ "test_directory",
+ ],
+ cwd=str(tmpdir),
+ stderr=subprocess.PIPE,
+ )
def test_jobs_score(self):
path = join(HERE, "regrtest_data", "unused_variable.py")