Spaces:
Running
Running
Commit
·
8570a81
1
Parent(s):
c7c02bf
More helpful error message for sklearn tests
Browse files- test/test.py +17 -7
test/test.py
CHANGED
|
@@ -377,12 +377,22 @@ class TestMiscellaneous(unittest.TestCase):
|
|
| 377 |
and check.func.__name__ in tests_requiring_determinism
|
| 378 |
):
|
| 379 |
# Skip test as PySR is not deterministic.
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
# If any checks failed don't let the test pass.
|
| 388 |
self.assertEqual([], exception_messages)
|
|
|
|
| 377 |
and check.func.__name__ in tests_requiring_determinism
|
| 378 |
):
|
| 379 |
# Skip test as PySR is not deterministic.
|
| 380 |
+
print(
|
| 381 |
+
"Failed",
|
| 382 |
+
check.func.__name__,
|
| 383 |
+
"which is an allowed failure, as the test requires determinism.",
|
| 384 |
+
)
|
| 385 |
+
else:
|
| 386 |
+
exception_messages.append(
|
| 387 |
+
f"{check.func.__name__}: {error_message}\n"
|
| 388 |
+
)
|
| 389 |
+
print("Failed", check.func.__name__, "with:")
|
| 390 |
+
# Add a leading tab to error message, which
|
| 391 |
+
# might be multi-line:
|
| 392 |
+
print(
|
| 393 |
+
"\n".join(
|
| 394 |
+
[(" " * 4) + row for row in error_message.split("\n")]
|
| 395 |
+
)
|
| 396 |
+
)
|
| 397 |
# If any checks failed don't let the test pass.
|
| 398 |
self.assertEqual([], exception_messages)
|