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):
5151 results = self .do_profiling ()
5252 expected = self .get_expected_output ()
5353 self .assertEqual (results [0 ], 1000 )
54+ fail = []
5455 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 ))
6166
6267 def test_calling_conventions (self ):
6368 # Issue #5330: profile and cProfile wouldn't report C functions called
You can’t perform that action at this time.
0 commit comments