Fix wrong exception expectation in test

This commit is contained in:
Jeremy Singer-Vine
2025-02-09 17:23:37 -05:00
parent 43ccc5b260
commit 8f5f498d8f
+2 -2
View File
@@ -237,11 +237,11 @@ class Test(unittest.TestCase):
def test_bad_fileobj(self): def test_bad_fileobj(self):
path = os.path.join(HERE, "pdfs/empty.pdf") path = os.path.join(HERE, "pdfs/empty.pdf")
with pytest.raises(pdfplumber.pdf.PSException): with pytest.raises(pdfplumber.utils.exceptions.PdfminerException):
pdfplumber.open(path) pdfplumber.open(path)
f = open(path) f = open(path)
with pytest.raises(pdfplumber.pdf.PSException): with pytest.raises(pdfplumber.utils.exceptions.PdfminerException):
pdfplumber.open(f) pdfplumber.open(f)
# File objects passed to pdfplumber should not be auto-closed # File objects passed to pdfplumber should not be auto-closed
assert not f.closed assert not f.closed