]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Configure pytest to properly locate conftest.py
authorTom Krizek <tkrizek@isc.org>
Thu, 20 Jul 2023 09:17:37 +0000 (11:17 +0200)
committerTom Krizek <tkrizek@isc.org>
Thu, 20 Jul 2023 11:27:03 +0000 (13:27 +0200)
In pytest 7.4.0, there were some changes to how the configuration file
for pytest is located. In our case, this resulted in a failure to find
the conftest.py with the needed fixtures which then prevented our python
tests from being executed successfully.

Configure the --confcutdir to ensure it points to the system test
directory, where our conftest.py is located.

Related https://github.com/pytest-dev/pytest/pull/11043

bin/tests/system/run.sh

index a57308dab9188f27223a13ca988d10af682205b6..2330d7c4a04654e2a9b01a611a8dd211765df9a5 100755 (executable)
@@ -237,7 +237,7 @@ if [ $status -eq 0 ]; then
             if start_servers; then
                 run=$((run+1))
                 test_status=0
-                (cd "$systest" && "$PYTEST" -rsxX -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
+                (cd "$systest" && "$PYTEST" --confcutdir ../ -rsxX -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
                 if [ -f "$systest/$test.status" ]; then
                     if [ "$(cat "$systest/$test.status")" != "5" ]; then
                         test_status=$(cat "$systest/$test.status")