diff --git a/Tests/test_file_tar.py b/Tests/test_file_tar.py index 9fc3edcd7..084d0f288 100644 --- a/Tests/test_file_tar.py +++ b/Tests/test_file_tar.py @@ -35,13 +35,13 @@ def test_unexpected_end(tmp_path: Path) -> None: with open(tmpfile, "w"): pass - with pytest.raises(OSError): + with pytest.raises(OSError, match="unexpected end of tar file"): with TarIO.TarIO(tmpfile, "test"): pass def test_cannot_find_subfile() -> None: - with pytest.raises(OSError): + with pytest.raises(OSError, match="cannot find subfile"): with TarIO.TarIO(TEST_TAR_FILE, "test"): pass