Skip to content

Commit 0aa56e5

Browse files
committed
Fix test that checked warning output
1 parent 8ad552d commit 0aa56e5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def testfile(filename):
7474

7575

7676
class FitFileTestCase(unittest.TestCase):
77+
7778
def test_basic_file_with_one_record(self, endian='<'):
7879
f = FitFile(generate_fitfile(endian=endian))
7980
f.parse()
@@ -414,7 +415,11 @@ def test_mismatched_field_size(self):
414415
with warnings.catch_warnings(record=True) as w:
415416
f.parse()
416417
assert w
417-
assert all("falling back to byte encoding" in str(x) for x in w)
418+
assert all(
419+
"falling back to byte encoding" in str(x)
420+
for x in w
421+
if x.category == UserWarning
422+
)
418423
self.assertEqual(len(f.messages), 11293)
419424

420425
def test_unterminated_file(self):

0 commit comments

Comments
 (0)