]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix skipping tests requiring dnspython
authorMichał Kępień <michal@isc.org>
Mon, 14 Mar 2022 07:59:32 +0000 (08:59 +0100)
committerMichał Kępień <michal@isc.org>
Mon, 14 Mar 2022 08:19:03 +0000 (09:19 +0100)
commit45bbb518d52025c576f2c8b726d0446dc968f6fc
treebddbb77837e8b7039badeeb8ca19c60291f93975
parentd9ae31be8cc93ff511318c7835d6a652a64e3fba
Fix skipping tests requiring dnspython

The intended purpose of the @pytest.mark.dnspython{,2} decorators was to
cause dnspython-based tests to be skipped if dnspython is not available
(or not recent enough).  However, a number of system tests employing
those decorators contain global "import dns.resolver" statements which
trigger ImportError exceptions during test initialization if dnspython
is not available.  In other words, the @pytest.mark.dnspython{,2}
decorators serve no useful purpose.

Currently, whenever a Python-based test requires dnspython, that
requirement applies to all tests in a given *.py file.  Given that,
employ global pytest.importorskip() calls to ensure dnspython-based
parts of various system tests are skipped when dnspython is not
available.  Remove all occurrences of the @pytest.mark.dnspython{,2}
decorators (and all associated code) to prevent confusion.

(cherry picked from commit 05c97f2329309506060e29c2935739aed6a815dd)
bin/tests/system/checkds/conftest.py [deleted file]
bin/tests/system/checkds/tests-checkds.py
bin/tests/system/shutdown/conftest.py [deleted file]
bin/tests/system/shutdown/tests-shutdown.py
bin/tests/system/timeouts/conftest.py
bin/tests/system/timeouts/tests-tcp.py