summaryrefslogtreecommitdiff
path: root/morphlib/stopwatch_tests.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-01-19 13:16:29 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-01-19 13:16:29 +0000
commit1132cfbcec0645fff7c4fa1883e0ff806311ec17 (patch)
tree1a7f0693d380c5b44c51b62b01b5ef38a38d47c9 /morphlib/stopwatch_tests.py
parent8766812d118279489d86fa2ba01b4ba73611a52a (diff)
downloadmorph-1132cfbcec0645fff7c4fa1883e0ff806311ec17.tar.gz
Use self.assert* everywhere instead of the assert statement.
Diffstat (limited to 'morphlib/stopwatch_tests.py')
-rw-r--r--morphlib/stopwatch_tests.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/morphlib/stopwatch_tests.py b/morphlib/stopwatch_tests.py
index d4f1e3dd..58a18a36 100644
--- a/morphlib/stopwatch_tests.py
+++ b/morphlib/stopwatch_tests.py
@@ -30,23 +30,23 @@ class StopwatchTests(unittest.TestCase):
def test_tick(self):
self.stopwatch.tick('tick', 'a')
- assert self.stopwatch.times('tick')
- assert self.stopwatch.time('tick', 'a')
- assert 'a' in self.stopwatch.times('tick')
+ self.assertTrue(self.stopwatch.times('tick'))
+ self.assertTrue(self.stopwatch.time('tick', 'a'))
+ self.assertIn('a', self.stopwatch.times('tick'))
self.assertEqual(self.stopwatch.time('tick', 'a'),
self.stopwatch.times('tick')['a'])
now = datetime.datetime.now()
- assert self.stopwatch.time('tick', 'a') < now
+ self.assertTrue(self.stopwatch.time('tick', 'a') < now)
def test_start_stop(self):
self.stopwatch.start('start-stop')
- assert self.stopwatch.times('start-stop')
- assert self.stopwatch.start_time('start-stop')
+ self.assertTrue(self.stopwatch.times('start-stop'))
+ self.assertTrue(self.stopwatch.start_time('start-stop'))
self.stopwatch.stop('start-stop')
- assert self.stopwatch.times('start-stop')
- assert self.stopwatch.stop_time('start-stop')
+ self.assertTrue(self.stopwatch.times('start-stop'))
+ self.assertTrue(self.stopwatch.stop_time('start-stop'))
start = self.stopwatch.start_time('start-stop')
stop = self.stopwatch.stop_time('start-stop')
@@ -55,7 +55,7 @@ class StopwatchTests(unittest.TestCase):
watch_delta = self.stopwatch.start_stop_delta('start-stop')
self.assertEqual(our_delta, watch_delta)
- assert self.stopwatch.start_stop_seconds('start-stop') > 0
+ self.assertTrue(self.stopwatch.start_stop_seconds('start-stop') > 0)
def test_with(self):
with self.stopwatch('foo'):