File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,18 @@ def test_cprofile(self):
51
51
results = self .do_profiling ()
52
52
expected = self .get_expected_output ()
53
53
self .assertEqual (results [0 ], 1000 )
54
+ fail = []
54
55
for i , method in enumerate (self .methodnames ):
55
- if results [i + 1 ] != expected [method ]:
56
- print ("Stats.%s output for %s doesn't fit expectation!" %
57
- (method , self .profilerclass .__name__ ))
58
- print ('\n ' .join (unified_diff (
59
- results [i + 1 ].split ('\n ' ),
60
- expected [method ].split ('\n ' ))))
56
+ a = expected [method ]
57
+ b = results [i + 1 ]
58
+ if a != b :
59
+ fail .append (f"\n Stats.{ method } output for "
60
+ f"{ self .profilerclass .__name__ } "
61
+ "does not fit expectation:" )
62
+ fail .extend (unified_diff (a .split ('\n ' ), b .split ('\n ' ),
63
+ lineterm = "" ))
64
+ if fail :
65
+ self .fail ("\n " .join (fail ))
61
66
62
67
def test_calling_conventions (self ):
63
68
# Issue #5330: profile and cProfile wouldn't report C functions called
You can’t perform that action at this time.
0 commit comments