@@ -21,24 +21,13 @@ def read_test(filepath):
21
21
return filepath .read_text ()
22
22
23
23
24
- def test (input_str , result , expected ):
25
- function_name = sys ._getframe (1 ).f_code .co_name
26
- error_message = (
27
- "A test error occurred, report it to MyNameIsTrez#1585!"
28
- f"\n \n Test function name: { function_name } "
29
- f"\n \n Input:\n { repr (input_str )} "
30
- f"\n \n Expected:\n { str (expected )} "
31
- f"\n \n Result:\n { str (result )} "
32
- )
33
-
34
- # print(result)
35
-
36
- # TODO: Comment these out before releasing this!
37
- # import json
38
- # with open("result.json", "w") as f:
39
- # f.write(json.dumps(result))
40
- # with open("expected.json", "w") as f:
41
- # f.write(json.dumps(expected))
42
-
43
- # TODO: Make the error_message not show twice in the popup.
44
- assert result == expected , error_message
24
+ def test (test_name , result , expected ):
25
+ if result != expected :
26
+ # TODO: Comment these out before releasing this!
27
+ import json
28
+ with open ("result.json" , "w" ) as f :
29
+ f .write (json .dumps (result , indent = 4 ))
30
+ with open ("expected.json" , "w" ) as f :
31
+ f .write (json .dumps (expected , indent = 4 ))
32
+
33
+ raise ValueError (f"The test '{ test_name } ' failed, report it to MyNameIsTrez#1585!" )
0 commit comments