Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit a06c51c

Browse files
committed
tests: Round predictions before equality assertion
Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
1 parent 6843db5 commit a06c51c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tests/integration/test_sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ async def test_string_keys(self):
104104
self.assertIn("Salary", results["prediction"])
105105
results = results["prediction"]["Salary"]
106106
self.assertIn("value", results)
107-
self.assertEqual(70.0, results["value"])
107+
self.assertEqual(70, round(results["value"]))

tests/test_high_level.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ async def test_predict(self):
130130
predictions = [
131131
prediction async for prediction in predict(model, predict_data)
132132
]
133-
self.assertEqual(predictions[0][2]["Salary"]["value"], 70)
134-
self.assertEqual(predictions[1][2]["Salary"]["value"], 80)
133+
self.assertEqual(round(predictions[0][2]["Salary"]["value"]), 70)
134+
self.assertEqual(round(predictions[1][2]["Salary"]["value"]), 80)
135135

136136

137137
class TestDataFlow(TestOrchestrator):

tests/test_noasync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ def test_predict(self):
7070
predictions = [
7171
prediction for prediction in predict(model, predict_data)
7272
]
73-
self.assertEqual(predictions[0][2]["Salary"]["value"], 70)
74-
self.assertEqual(predictions[1][2]["Salary"]["value"], 80)
73+
self.assertEqual(round(predictions[0][2]["Salary"]["value"]), 70)
74+
self.assertEqual(round(predictions[1][2]["Salary"]["value"]), 80)

0 commit comments

Comments
 (0)