Skip to content

Commit 2504d6b

Browse files
authored
test: Fix comparison of tuple of floats in TestDxfDocument::test_spline (#1414)
Use pytest.approx instead of unnittest.assertEqual assertAlmostEqual.
1 parent 13344cd commit 2504d6b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_exporters.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,14 @@ def test_spline(self):
415415
)
416416

417417
self.assertEqual(expected_type, result_type)
418-
self.assertAlmostEqual(
418+
419+
for expected, result in zip(
419420
expected_attributes["control_points"], result_attributes["control_points"]
420-
)
421+
):
422+
assert result == approx(expected)
423+
421424
self.assertEqual(expected_attributes["order"], result_attributes["order"])
422-
self.assertEqual(expected_attributes["knots"], result_attributes["knots"])
425+
assert result_attributes["knots"] == approx(expected_attributes["knots"])
423426
self.assertEqual(expected_attributes["weights"], result_attributes["weights"])
424427

425428
def test_add_layer_definition(self):

0 commit comments

Comments
 (0)