Skip to content

Commit 13b44ad

Browse files
committed
fix unit test
1 parent 40ac372 commit 13b44ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chronograph/tests/test_chronograph.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_example8(self):
9292
cg = Chronograph(name="TestCase", throw_exceptions=True)
9393

9494
cg.start()
95-
self.assertRaises(ChronographError, cg.start()) # can't start a Chronograph that's already started!
95+
self.assertRaises(ChronographError, cg.start) # can't start a Chronograph that's already started!
9696

9797
def test_example8b(self):
9898
cg = Chronograph(name="TestCase", throw_exceptions=False)
@@ -101,9 +101,10 @@ def test_example8b(self):
101101
cg.start() # shouldn't throw exception
102102

103103
t1 = cg.total_elapsed_time
104-
c1 = cg.last_split_time
104+
c1 = get_split_time(cg.timing_data[0], allow_still_running=True)
105+
time.sleep(0.1)
105106
t2 = cg.total_elapsed_time
106-
c2 = cg.last_split_time
107+
c2 = get_split_time(cg.timing_data[0], allow_still_running=True)
107108
self.assertGreater(t2, t1)
108109
self.assertGreater(c2, c1)
109110

0 commit comments

Comments
 (0)