]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: pylint: fix raise-missing-from warning (W0707)
authorLukáš Ježek <lukas.jezek@nic.cz>
Wed, 16 Sep 2020 11:09:43 +0000 (13:09 +0200)
committerLukáš Ježek <lukas.jezek@nic.cz>
Wed, 16 Sep 2020 11:09:43 +0000 (13:09 +0200)
tests/pytests/kresd.py
tests/pytests/utils.py

index 75776f2ea4895f6128660e6cbf0d372e970a441b..f190003db66f3878aee8740d54df6d5e1b406168 100644 (file)
@@ -263,9 +263,9 @@ def take_port(port, ip=None, ip6=None, timeout=0):
     end_time = time.time() + timeout
     try:
         port_path.touch(exist_ok=False)
-    except FileExistsError:
+    except FileExistsError as ex:
         raise ValueError(
-            "Port {} already reserved by system or another kresd instance!".format(port))
+            "Port {} already reserved by system or another kresd instance!".format(port)) from ex
 
     while True:
         if is_port_free(port, ip, ip6):
index 2953f2a613d5f14fa0f9fad81b53f20af6c884ff..812b6f3ce61ed66cce82a03b5d676f3f77aadfb2 100644 (file)
@@ -103,9 +103,9 @@ def expect_kresd_close(rst_ok=False):
         try:
             time.sleep(0.2)  # give kresd time to close connection with TCP FIN
             yield
-        except ConnectionResetError:
+        except ConnectionResetError as ex:
             if rst_ok:
-                raise BrokenPipeError
+                raise BrokenPipeError from ex
             pytest.skip("kresd closed connection with TCP RST")
         pytest.fail("kresd didn't close the connection")