]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Allow assertion message rewrite in statschannel test
authorTom Krizek <tkrizek@isc.org>
Fri, 24 Nov 2023 14:50:08 +0000 (15:50 +0100)
committerTom Krizek <tkrizek@isc.org>
Tue, 5 Dec 2023 13:27:41 +0000 (14:27 +0100)
By default, the useful assertion message rewrite is used by pytest for
test modules only. Since another module is imported with shared
functionality, ensure it has pytest's assertion message rewriting
enabled to obtain more debug information in case it fails.

(cherry picked from commit a57af8163aeb3ca1506ec5ebced922d8a3439667)

bin/tests/system/statschannel/tests_json.py
bin/tests/system/statschannel/tests_xml.py

index cf1deb6fd3ec0400907baa3cdc77c122cbfce1fa..2cd7a537c9ac342b5b02c29fc312667ee08197b5 100755 (executable)
@@ -15,9 +15,11 @@ from datetime import datetime
 
 import pytest
 
-import generic
 import pytest_custom_markers
 
+pytest.register_assert_rewrite("generic")
+import generic
+
 pytestmark = pytest_custom_markers.have_json_c
 requests = pytest.importorskip("requests")
 
index 29c2e88bfd598e7a6355c6fac10d1625c3e80a34..5f92a699009f64bf5d43f23bc1a76a3ef3d143ed 100755 (executable)
@@ -16,9 +16,11 @@ import xml.etree.ElementTree as ET
 
 import pytest
 
-import generic
 import pytest_custom_markers
 
+pytest.register_assert_rewrite("generic")
+import generic
+
 pytestmark = pytest_custom_markers.have_libxml2
 requests = pytest.importorskip("requests")