Skip to content

Commit

Permalink
Fix test that checked warning output
Browse files Browse the repository at this point in the history
  • Loading branch information
pR0Ps committed Jan 14, 2024
1 parent 8ad552d commit 0aa56e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def testfile(filename):


class FitFileTestCase(unittest.TestCase):

def test_basic_file_with_one_record(self, endian='<'):
f = FitFile(generate_fitfile(endian=endian))
f.parse()
Expand Down Expand Up @@ -414,7 +415,11 @@ def test_mismatched_field_size(self):
with warnings.catch_warnings(record=True) as w:
f.parse()
assert w
assert all("falling back to byte encoding" in str(x) for x in w)
assert all(
"falling back to byte encoding" in str(x)
for x in w
if x.category == UserWarning
)
self.assertEqual(len(f.messages), 11293)

def test_unterminated_file(self):
Expand Down

0 comments on commit 0aa56e5

Please sign in to comment.