summaryrefslogtreecommitdiff
path: root/tests/test_doh.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-05-01 12:57:55 -0700
committerBob Halley <halley@dnspython.org>2020-05-01 12:57:55 -0700
commit46d5a82cdf88ea45243254aa178086b83e1cb103 (patch)
treefecd8cb4fdcf589d397ff2d59859b619ab2af025 /tests/test_doh.py
parent3f115ff2054c8859c9cd280de38b3ce5055178d6 (diff)
downloaddnspython-46d5a82cdf88ea45243254aa178086b83e1cb103.tar.gz
fix lingering unguarded requests imports
Diffstat (limited to 'tests/test_doh.py')
-rw-r--r--tests/test_doh.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_doh.py b/tests/test_doh.py
index 2e16aa2..7e66d0a 100644
--- a/tests/test_doh.py
+++ b/tests/test_doh.py
@@ -18,13 +18,14 @@ import base64
import unittest
import random
-import requests
-from requests.exceptions import SSLError
-
import dns.query
import dns.rdatatype
import dns.message
+if dns.query.have_doh:
+ import requests
+ from requests.exceptions import SSLError
+
KNOWN_ANYCAST_DOH_RESOLVER_IPS = ['1.1.1.1', '8.8.8.8', '9.9.9.9']
KNOWN_ANYCAST_DOH_RESOLVER_URLS = ['https://cloudflare-dns.com/dns-query',
'https://dns.google/dns-query',