]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
attempt to workaround curio exceptions that happen only in CI
authorBob Halley <halley@dnspython.org>
Sat, 11 Jun 2022 19:29:35 +0000 (12:29 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 11 Jun 2022 19:29:35 +0000 (12:29 -0700)
tests/test_async.py

index f40146e216a6a7197e607a953b507d53ab1a2665..d6f188fe9d8943d11d8e02dee68f35fd3b36f7e2 100644 (file)
@@ -559,13 +559,15 @@ try:
         sniff_result = "curio"
 
         def async_run(self, afunc):
-            return curio.run(afunc)
+            with curio.Kernel() as kernel:
+                return kernel.run(afunc, shutdown=True)
 
     class CurioNoSniffioAsyncDetectionTests(NoSniffioAsyncDetectionTests):
         expect_raise = True
 
         def async_run(self, afunc):
-            return curio.run(afunc)
+            with curio.Kernel() as kernel:
+                return kernel.run(afunc, shutdown=True)
 
     class CurioAsyncTests(AsyncTests):
         connect_udp = False
@@ -574,7 +576,8 @@ try:
             self.backend = dns.asyncbackend.set_default_backend("curio")
 
         def async_run(self, afunc):
-            return curio.run(afunc)
+            with curio.Kernel() as kernel:
+                return kernel.run(afunc, shutdown=True)
 
 except ImportError:
     pass