Skip to content

Commit

Permalink
Fixed final test_axographio.py test for Python 3
Browse files Browse the repository at this point in the history
In Python 2, round() always returns a float. In Python 3, the original data type is returned. For this test, the rounded value had type numpy.float32, which is not considered equivalent to a float in Python 3 (64-bit machines only, presumably). Fixed by converting the value to a float before rounding.
  • Loading branch information
jpgill86 committed May 30, 2018
1 parent 23f1a52 commit 6682b83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_axographio.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_graphfile(self):
self.assertEqual(len(d), 2048)
self.assertEqual(round(sum(file.data[1]),13), -2.1483816e-6)
self.assertEqual(round(sum(file.data[2]),13), -1.4318602e-6)
self.assertEqual(round(file.data[0][2047],6), 1.024)
self.assertEqual(round(float(file.data[0][2047]),6), 1.024)


def test_axograph_x_file(self):
Expand Down

0 comments on commit 6682b83

Please sign in to comment.