From: Bob Halley Date: Tue, 21 Dec 2021 15:59:09 +0000 (-0800) Subject: skip async DoH tests if no httpx X-Git-Tag: v2.2.0rc1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b714f6f410ee526924ef2f27979dee05e40ee4c;p=thirdparty%2Fdnspython.git skip async DoH tests if no httpx (cherry picked from commit ec5bee76861f3da38dd6b72f01c28ea888a346c8) --- diff --git a/tests/test_async.py b/tests/test_async.py index c7425e61..4759b029 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -428,6 +428,7 @@ class AsyncTests(unittest.TestCase): self.async_run(arun) self.assertRaises(dns.exception.Timeout, run) + @unittest.skipIf(not dns.query._have_httpx, "httpx not available") def testDOHGetRequest(self): if self.backend.name() == 'curio': self.skipTest('anyio dropped curio support') @@ -439,6 +440,7 @@ class AsyncTests(unittest.TestCase): self.assertTrue(q.is_response(r)) self.async_run(run) + @unittest.skipIf(not dns.query._have_httpx, "httpx not available") def testDOHGetRequestHttp1(self): if self.backend.name() == 'curio': self.skipTest('anyio dropped curio support') @@ -455,6 +457,7 @@ class AsyncTests(unittest.TestCase): dns.query._have_http2 = saved_have_http2 self.async_run(run) + @unittest.skipIf(not dns.query._have_httpx, "httpx not available") def testDOHPostRequest(self): if self.backend.name() == 'curio': self.skipTest('anyio dropped curio support') @@ -466,7 +469,8 @@ class AsyncTests(unittest.TestCase): self.assertTrue(q.is_response(r)) self.async_run(run) - def test_resolver_doh(self): + @unittest.skipIf(not dns.query._have_httpx, "httpx not available") + def testResolverDOH(self): if self.backend.name() == 'curio': self.skipTest('anyio dropped curio support') async def run():