make deprecation check more specific

This commit is contained in:
Yay295 2023-02-07 13:58:05 -06:00
parent 0f27ddafb7
commit dd985b2a5e

View File

@ -311,7 +311,6 @@ def test_read_binary_preview():
pass
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
def test_readline_psfile(tmp_path):
# check all the freaking line endings possible from the spec
# test_string = u'something\r\nelse\n\rbaz\rbif\n'
@ -329,6 +328,7 @@ def test_readline_psfile(tmp_path):
def _test_readline_io_psfile(test_string, ending):
f = io.BytesIO(test_string.encode("latin-1"))
with pytest.warns(DeprecationWarning):
t = EpsImagePlugin.PSFile(f)
_test_readline(t, ending)
@ -338,6 +338,7 @@ def test_readline_psfile(tmp_path):
w.write(test_string.encode("latin-1"))
with open(f, "rb") as r:
with pytest.warns(DeprecationWarning):
t = EpsImagePlugin.PSFile(r)
_test_readline(t, ending)