From dde85fdff4358a7ed2f17b28674b6b1ede95df9b Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Wed, 6 Sep 2017 08:35:32 -0400 Subject: [PATCH] Change the inherited exception class in tests As of pytest 3.2.0, the internal outcome class no longer inherits from Exception, rather from BaseException. This was reported in pytest-dev/pytest#580 and changed in pytest-dev/pytest#2490 Signed-off-by: Mike Fiedler --- tests/test_socket.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_socket.py b/tests/test_socket.py index 58caa1c..813ba19 100644 --- a/tests/test_socket.py +++ b/tests/test_socket.py @@ -27,7 +27,7 @@ def test_socket(): """) result = testdir.runpytest("--verbose") result.assert_outcomes(1, 0, 0) - with pytest.raises(Exception): + with pytest.raises(BaseException): assert_socket_blocked(result) @@ -188,7 +188,7 @@ def test_disable_enable(): """) result = testdir.runpytest("--verbose") result.assert_outcomes(3, 0, 0) - with pytest.raises(Exception): + with pytest.raises(BaseException): assert_socket_blocked(result) @@ -200,7 +200,7 @@ def test_socket_enabled(socket_enabled): """) result = testdir.runpytest("--verbose") result.assert_outcomes(1, 0, 0) - with pytest.raises(Exception): + with pytest.raises(BaseException): assert_socket_blocked(result)