Rework imports in dnspython-based system tests

Ensure all "import dns.*" statements are always placed after
pytest.importorskip('dns') calls, in order to allow the latter to
fulfill their purpose.  Explicitly import all dnspython modules used by
each dnspython-based test to avoid relying on nested imports.  Replace
function-scoped imports with global imports to reduce code duplication.

(cherry picked from commit 49312d6bb2)
This commit is contained in:
Michał Kępień
2022-03-14 08:59:32 +01:00
parent 238781de4a
commit ac229a2fd5
6 changed files with 22 additions and 31 deletions

View File

@@ -21,6 +21,8 @@ import pytest
pytest.importorskip('dns')
import dns.exception
import dns.message
import dns.name
import dns.rdataclass
import dns.rdatatype