summaryrefslogtreecommitdiff
path: root/morphlib/stopwatch_tests.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-01-19 14:29:34 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-01-19 14:29:34 +0000
commitdd8231cfe716bd691fa8d0caa82e2f94737318c4 (patch)
tree4b8f7af0b924827251b41baaadf5b40f88d37a3a /morphlib/stopwatch_tests.py
parent96143d48f432d08be650ea69cbd56cb50988e855 (diff)
downloadmorph-dd8231cfe716bd691fa8d0caa82e2f94737318c4.tar.gz
Get rid of assertIn, assertNotIn that are only available in Python 2.7.
Diffstat (limited to 'morphlib/stopwatch_tests.py')
-rw-r--r--morphlib/stopwatch_tests.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/morphlib/stopwatch_tests.py b/morphlib/stopwatch_tests.py
index 58a18a36..0d4d98d9 100644
--- a/morphlib/stopwatch_tests.py
+++ b/morphlib/stopwatch_tests.py
@@ -32,7 +32,7 @@ class StopwatchTests(unittest.TestCase):
self.stopwatch.tick('tick', 'a')
self.assertTrue(self.stopwatch.times('tick'))
self.assertTrue(self.stopwatch.time('tick', 'a'))
- self.assertIn('a', self.stopwatch.times('tick'))
+ self.assertTrue('a' in self.stopwatch.times('tick'))
self.assertEqual(self.stopwatch.time('tick', 'a'),
self.stopwatch.times('tick')['a'])
@@ -60,16 +60,16 @@ class StopwatchTests(unittest.TestCase):
def test_with(self):
with self.stopwatch('foo'):
pass
- self.assert_(self.stopwatch.start_stop_seconds('foo') < 1.0)
+ self.assertTrue(self.stopwatch.start_stop_seconds('foo') < 1.0)
def test_with_within_with(self):
with self.stopwatch('foo'):
with self.stopwatch('bar'):
pass
- self.assert_(self.stopwatch.start_time('foo'))
- self.assert_(self.stopwatch.stop_time('foo'))
- self.assert_(self.stopwatch.start_time('bar'))
- self.assert_(self.stopwatch.stop_time('bar'))
- self.assert_(self.stopwatch.start_stop_seconds('foo') < 1.0)
- self.assert_(self.stopwatch.start_stop_seconds('bar') < 1.0)
+ self.assertTrue(self.stopwatch.start_time('foo') is not None)
+ self.assertTrue(self.stopwatch.stop_time('foo') is not None)
+ self.assertTrue(self.stopwatch.start_time('bar') is not None)
+ self.assertTrue(self.stopwatch.stop_time('bar') is not None)
+ self.assertTrue(self.stopwatch.start_stop_seconds('foo') < 1.0)
+ self.assertTrue(self.stopwatch.start_stop_seconds('bar') < 1.0)