Fix feature detection for pytest markers in tests

The condition was accidentally reversed during refactoring in
9730ac4c56 . It would result in skipped
tests on builds with proper support and false negatives on builds
without proper feature support.

Credit for reporting the issue and the fix goes to Stanislav Levin.

(cherry picked from commit 473cb530f4)
This commit is contained in:
Tom Krizek 2023-01-17 14:18:22 +01:00
parent aee89c3454
commit 58ff3b4fc0
No known key found for this signature in database
GPG key ID: 01623B9B652A20A7

View file

@ -34,9 +34,9 @@ def feature_test(feature):
have_libxml2 = pytest.mark.skipif(
feature_test("--have-libxml2"), reason="libxml2 support disabled in the build"
not feature_test("--have-libxml2"), reason="libxml2 support disabled in the build"
)
have_json_c = pytest.mark.skipif(
feature_test("--have-json-c"), reason="json-c support disabled in the build"
not feature_test("--have-json-c"), reason="json-c support disabled in the build"
)