Skip to content

Commit

Permalink
Fix typo in api docs (#145)
Browse files Browse the repository at this point in the history
* Fix typo in api docs

* Fix test that checked warning output
  • Loading branch information
pR0Ps committed Jan 14, 2024
1 parent 4fc9cd8 commit 9bd14c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The ``FitFile`` Object
try:
fitfile = FitFile('/path.to/fitfile.fit')
fitfile.parse()
except FitParseError, e:
except FitParseError as e:
print "Error while parsing .FIT file: %s" % e
sys.exit(1)

Expand Down
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 9bd14c4

Please sign in to comment.