From 19010bb301e559dd6c9b255c9e3134bbde31297f Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:49:08 +1100 Subject: [PATCH] Use match Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Tests/test_file_tar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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