diff --git a/tests/unit/misc/test_lineparser.py b/tests/unit/misc/test_lineparser.py index dcdb724cd..cd4a64274 100644 --- a/tests/unit/misc/test_lineparser.py +++ b/tests/unit/misc/test_lineparser.py @@ -114,7 +114,8 @@ class TestLineParser: def test_double_open(self, lineparser): """Test if save() bails on an already open file.""" with lineparser._open('r'): - with pytest.raises(IOError): + with pytest.raises(IOError, + match="Refusing to double-open LineParser."): lineparser.save() def test_prepare_save(self, tmpdir, lineparser):