summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukáš Ježek <lukas.jezek@nic.cz>2020-09-16 13:09:43 +0200
committerLukáš Ježek <lukas.jezek@nic.cz>2020-09-16 13:09:43 +0200
commit5c96fc4a883936214a4207020030fc54a62f84da (patch)
treebf27002955d7ec6038bbd7b6ea902ebfe6fc553e /tests
parentci: use docker image with knot 3.0 (diff)
downloadknot-resolver-5c96fc4a883936214a4207020030fc54a62f84da.tar.xz
knot-resolver-5c96fc4a883936214a4207020030fc54a62f84da.zip
ci: pylint: fix raise-missing-from warning (W0707)
Diffstat (limited to 'tests')
-rw-r--r--tests/pytests/kresd.py4
-rw-r--r--tests/pytests/utils.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/pytests/kresd.py b/tests/pytests/kresd.py
index 75776f2e..f190003d 100644
--- a/tests/pytests/kresd.py
+++ b/tests/pytests/kresd.py
@@ -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):
diff --git a/tests/pytests/utils.py b/tests/pytests/utils.py
index 2953f2a6..812b6f3c 100644
--- a/tests/pytests/utils.py
+++ b/tests/pytests/utils.py
@@ -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")