From 157db3e01fd08b0f0ba6770ed420e1b7931fb55f Mon Sep 17 00:00:00 2001 From: vrde Date: Tue, 31 Jan 2017 16:59:43 +0100 Subject: [PATCH] Fix exception in test --- tests/backend/mongodb/test_connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/backend/mongodb/test_connection.py b/tests/backend/mongodb/test_connection.py index 49ab0604..60181f25 100644 --- a/tests/backend/mongodb/test_connection.py +++ b/tests/backend/mongodb/test_connection.py @@ -56,13 +56,14 @@ def test_get_connection_returns_the_correct_instance(): @mock.patch('time.sleep') def test_connection_error(mock_sleep, mock_client, mock_init_repl_set): from bigchaindb.backend import connect + from bigchaindb.backend.exceptions import ConnectionError # force the driver to trow ConnectionFailure # the mock on time.sleep is to prevent the actual sleep when running # the tests mock_client.side_effect = ConnectionFailure() - with pytest.raises(ConnectionFailure): + with pytest.raises(ConnectionError): conn = connect() conn.db