Fix pytest deprecation warnings
This commit is contained in:
@@ -173,17 +173,15 @@ def test_stack_abuse():
|
||||
p = pikepdf.Pdf.new()
|
||||
|
||||
stream = pikepdf.Stream(p, b'q ' * 35)
|
||||
with pytest.warns(None) as record:
|
||||
with pytest.warns(UserWarning, match="overflowed"):
|
||||
pdfinfo.info._interpret_contents(stream)
|
||||
assert 'overflowed' in str(record[0].message)
|
||||
|
||||
stream = pikepdf.Stream(p, b'q Q Q Q Q')
|
||||
with pytest.warns(None) as record:
|
||||
with pytest.warns(UserWarning, match="underflowed") as record:
|
||||
pdfinfo.info._interpret_contents(stream)
|
||||
assert 'underflowed' in str(record[0].message)
|
||||
|
||||
stream = pikepdf.Stream(p, b'q ' * 135)
|
||||
with pytest.warns(None):
|
||||
with pytest.warns():
|
||||
with pytest.raises(RuntimeError):
|
||||
pdfinfo.info._interpret_contents(stream)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user