Skip to content

Commit

Permalink
better assert no error
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Sep 6, 2024
1 parent e6312a6 commit 7911e0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_empty_file(self):
with pytest.warns(match="File empty, use default line ending \n."):
with open(os.path.join(TEST_DIR, "empty_file.txt"), encoding="utf-8") as f:
for _line in reverse_readline(f):
raise ValueError("an empty file is being read!")
pytest.fail("No error should be thrown.")

@pytest.mark.parametrize("l_end", ["\n", "\r", "\r\n"])
def test_line_ending(self, l_end):
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_empty_file(self):
"""
with pytest.warns(match="File empty, use default line ending \n."):
for _line in reverse_readfile(os.path.join(TEST_DIR, "empty_file.txt")):
raise ValueError("an empty file is being read!")
pytest.fail("No error should be thrown.")

@pytest.mark.parametrize("l_end", ["\n", "\r", "\r\n"])
def test_line_ending(self, l_end):
Expand Down

0 comments on commit 7911e0a

Please sign in to comment.