Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure consistency check in test runs even if expected error occurs #402

Merged
merged 1 commit into from Apr 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/unit/test_fileio.py
Expand Up @@ -388,7 +388,7 @@ def test_seek(self):
with self.assertRaises(ValueError):
pos = buff.tell()
buff.seek(len(TEST_BINARY_DATA) + 1)
self.assertEqual(pos, buff.tell())
self.assertEqual(pos, buff.tell())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened here? is there more context

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 390 raises the exception in which the destination byte is not contained in buffer, so the test never hits Line 391. This change ensures all assertions are run.


# Read 8 bytes, test seek backwards, read again, and flush.
self.assertEqual(buff.read(8), TEST_BINARY_DATA[:8])
Expand All @@ -401,7 +401,7 @@ def test_seek(self):
with self.assertRaises(ValueError):
pos = buff.tell()
buff.seek(0)
self.assertEqual(pos, buff.tell())
self.assertEqual(pos, buff.tell())

def test_close(self):
buff = SlidingBuffer()
Expand Down