Skip to content

Commit

Permalink
make deprecation check more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Feb 7, 2023
1 parent 0f27dda commit dd985b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Tests/test_file_eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -329,7 +328,8 @@ def _test_readline(t, ending):

def _test_readline_io_psfile(test_string, ending):
f = io.BytesIO(test_string.encode("latin-1"))
t = EpsImagePlugin.PSFile(f)
with pytest.warns(DeprecationWarning):
t = EpsImagePlugin.PSFile(f)
_test_readline(t, ending)

def _test_readline_file_psfile(test_string, ending):
Expand All @@ -338,7 +338,8 @@ def _test_readline_file_psfile(test_string, ending):
w.write(test_string.encode("latin-1"))

with open(f, "rb") as r:
t = EpsImagePlugin.PSFile(r)
with pytest.warns(DeprecationWarning):
t = EpsImagePlugin.PSFile(r)
_test_readline(t, ending)

for ending in line_endings:
Expand Down

0 comments on commit dd985b2

Please sign in to comment.