]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests/pytests: fix deprecation warning with latest pytest
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 4 Feb 2019 11:56:08 +0000 (12:56 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:41:55 +0000 (10:41 +0100)
tests/pytests/utils.py

index c9ad48c7a90baf5b19805a0ac4e766543cb0c734..46bd279e503659003634651e28b821aac9b12815 100644 (file)
@@ -98,7 +98,7 @@ def ping_alive(sock, msgid=None):
 
 @contextmanager
 def expect_kresd_close(rst_ok=False):
-    with pytest.raises(BrokenPipeError, message="kresd didn't close the connection"):
+    with pytest.raises(BrokenPipeError):
         try:
             time.sleep(0.2)  # give kresd time to close connection with TCP FIN
             yield
@@ -107,6 +107,7 @@ def expect_kresd_close(rst_ok=False):
                 raise BrokenPipeError
             else:
                 pytest.skip("kresd closed connection with TCP RST")
+        pytest.fail("kresd didn't close the connection")
 
 
 def make_ssl_context(insecure=False, verify_location=None, extra_options=None):