diff --git a/tests/unit/misc/test_lineparser.py b/tests/unit/misc/test_lineparser.py index 3ea07a831..f5fbb2f4d 100644 --- a/tests/unit/misc/test_lineparser.py +++ b/tests/unit/misc/test_lineparser.py @@ -66,10 +66,10 @@ class TestBaseLineParser: mocker.patch('builtins.open', mock.mock_open()) with lineparser._open('r'): - with pytest.raises(IOError) as excinfo: + with pytest.raises(IOError) as excinf: with lineparser._open('r'): pass - assert str(excinfo.value) == 'Refusing to double-open AppendLineParser.' + assert str(excinf.value) == 'Refusing to double-open AppendLineParser.' def test_binary(self, mocker): """Test if _open and _write correctly handle binary files.""" diff --git a/tests/unit/misc/test_utilcmds.py b/tests/unit/misc/test_utilcmds.py index 1cdfed2f6..5445f91d2 100644 --- a/tests/unit/misc/test_utilcmds.py +++ b/tests/unit/misc/test_utilcmds.py @@ -79,7 +79,7 @@ def test_debug_trace(mocker): raise Exception('message') hunter_mock.trace.side_effect = Exception - with pytest.raises(CommandError) as excinfo: + with pytest.raises(cmdexc.CommandError) as excinfo: utilcmds.debug_trace() assert str(excinfo.value) == 'Exception: message'