Mercurial > public > mercurial-scm > hg-stable
diff tests/test-util.py @ 39286:331ab85e910b
cleanup: make all uses of timedcm specify what they're timing
It's not used in the timing itself, but it's valuable for the trace
events we emit.
Differential Revision: https://phab.mercurial-scm.org/D4349
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 21 Aug 2018 17:15:51 -0400 |
parents | 9d49bb117dde |
children | 2372284d9457 |
line wrap: on
line diff
--- a/tests/test-util.py Tue Aug 21 17:13:35 2018 -0400 +++ b/tests/test-util.py Tue Aug 21 17:15:51 2018 -0400 @@ -78,7 +78,7 @@ def testtimedcmcleanexit(self): # timestamps 1, 4, elapsed time of 4 - 1 = 3 with mocktimer([1, 3], _start_default): - with util.timedcm() as stats: + with util.timedcm('pass') as stats: # actual context doesn't matter pass @@ -89,8 +89,8 @@ def testtimedcmnested(self): # timestamps 1, 3, 6, 10, elapsed times of 6 - 3 = 3 and 10 - 1 = 9 with mocktimer([1, 2, 3, 4], _start_default): - with util.timedcm() as outer_stats: - with util.timedcm() as inner_stats: + with util.timedcm('outer') as outer_stats: + with util.timedcm('inner') as inner_stats: # actual context doesn't matter pass @@ -106,7 +106,7 @@ # timestamps 1, 4, elapsed time of 4 - 1 = 3 with mocktimer([1, 3], _start_default): try: - with util.timedcm() as stats: + with util.timedcm('exceptional') as stats: raise ValueError() except ValueError: pass