]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Temporarily change pytest.PytestRemovedIn9Warning error to warning
authorMichal Nowak <mnowak@isc.org>
Tue, 16 Dec 2025 18:03:38 +0000 (19:03 +0100)
committerMichal Nowak (GitLab job 6633213) <mnowak@isc.org>
Tue, 16 Dec 2025 20:28:55 +0000 (20:28 +0000)
We need this to be able to use pytest 9.0 from Debian "sid".

Additionally, this error needs to be addressed before pytest 9.1 is
released, as the filter will no longer work. Also, all pytests in CI
images need to be upgraded to version 7, where the new API is supported.

We can't have the "filterwarnings" section in pytest.ini directly as
only pytest 8.0 knows about it.

(cherry picked from commit 0c5d9c00ef595f81afe8c0c7c2e9ee2128e13284)

.gitlab-ci.yml

index 1cf0394bcfb7f5180a0368429e8c81814dc38943..89ca4415e83031698750628426b2f141abd6c366 100644 (file)
@@ -573,6 +573,10 @@ stages:
     - ( if [ "${CI_DISPOSABLE_ENVIRONMENT}" = "true" ]; then sleep 3000; "$PYTHON" "${CI_PROJECT_DIR}/util/get-running-system-tests.py"; fi ) &
     - cd bin/tests/system
     - RET=0
+    # With pytest 9.0, there's the following error in pytest_ignore_collect():
+    #   The (path: py.path.local) argument is deprecated, please use (collection_path: pathlib.Path).
+    # This should be fixed before pytest 9.1, when it becomes ineffective.
+    - if pytest --version | grep -F "pytest 9.0" >/dev/null; then echo "filterwarnings = ignore::pytest.PytestRemovedIn9Warning" >> pytest.ini; fi
     - >
       ("$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt) || RET=1
     - *check_for_junit_xml