python3Packages.pytest-pylint: fix tests with newer pytest (#521575)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
fetchpatch2,
|
||||
setuptools,
|
||||
pylint,
|
||||
pytest,
|
||||
@@ -19,6 +20,17 @@ buildPythonPackage rec {
|
||||
hash = "sha256-iHZLjh1c+hiAkkjgzML8BQNfCMNfCwIi3c/qHDxOVT4=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Use pathlib.Path in plugin hooks for pytest 8.1+ compatibility.
|
||||
(fetchpatch2 {
|
||||
url = "https://github.com/carsongee/pytest-pylint/commit/62457e8013df106116fb2a62c7c44870103ff393.patch?full_index=1";
|
||||
hash = "sha256-EnlHEe5uZkvrWO8B33xkQ3LCQ7Bj5/oLES//NP8vkwE=";
|
||||
})
|
||||
# Handle test output difference in pytest 9.
|
||||
# https://github.com/carsongee/pytest-pylint/pull/196
|
||||
./pytest-9.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail "pytest-runner" ""
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/pytest_pylint/tests/test_pytest_pylint.py b/pytest_pylint/tests/test_pytest_pylint.py
|
||||
index 4c87ac336690defb2f2d472b389945c91fae5d31..f6478c018f5974acb2fdd95f1d461ca71e1302ba 100644
|
||||
--- a/pytest_pylint/tests/test_pytest_pylint.py
|
||||
+++ b/pytest_pylint/tests/test_pytest_pylint.py
|
||||
@@ -38,7 +38,7 @@ def test_nodeid_no_dupepath(testdir):
|
||||
testdir.makepyfile(app="import sys")
|
||||
result = testdir.runpytest("--pylint", "--verbose")
|
||||
assert re.search(
|
||||
- r"^FAILED\s+app\.py::PYLINT$", result.stdout.str(), flags=re.MULTILINE
|
||||
+ r"^FAILED\s+app\.py::PYLINT( |$)", result.stdout.str(), flags=re.MULTILINE
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user