From: Bob Halley Date: Fri, 1 May 2020 19:57:55 +0000 (-0700) Subject: fix lingering unguarded requests imports X-Git-Tag: v2.0.0rc1~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46d5a82cdf88ea45243254aa178086b83e1cb103;p=thirdparty%2Fdnspython.git fix lingering unguarded requests imports --- diff --git a/tests/test_doh.py b/tests/test_doh.py index 2e16aa23..7e66d0ae 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',