summaryrefslogtreecommitdiff
path: root/morphlib/stopwatch_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-07-31 12:52:12 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-08-01 13:12:03 +0000
commit0032ccbd60f202ec76d9b738cddc8bdbf9f54133 (patch)
treecd398ab063be0bdab20b91cbd2420ad4981de813 /morphlib/stopwatch_tests.py
parent93a3d28ee51cc301cd79ff8bfabb2010defda09b (diff)
downloadmorph-0032ccbd60f202ec76d9b738cddc8bdbf9f54133.tar.gz
python scripts: pep8ize codebase
This was done with the aid of the pep8 script, available by running `easy_install pep8`. It may be worth making this part of ./check, but that will require putting pep8 into the development tools stratum. This should be easy, given pep8 has no external dependencies.
Diffstat (limited to 'morphlib/stopwatch_tests.py')
-rw-r--r--morphlib/stopwatch_tests.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/morphlib/stopwatch_tests.py b/morphlib/stopwatch_tests.py
index 76490de8..deb528d5 100644
--- a/morphlib/stopwatch_tests.py
+++ b/morphlib/stopwatch_tests.py
@@ -1,14 +1,14 @@
# Copyright (C) 2011-2012 Codethink Limited
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -24,15 +24,15 @@ class StopwatchTests(unittest.TestCase):
def setUp(self):
self.stopwatch = morphlib.stopwatch.Stopwatch()
-
+
def test_tick(self):
self.stopwatch.tick('tick', 'a')
self.assertTrue(self.stopwatch.times('tick'))
self.assertTrue(self.stopwatch.time('tick', 'a'))
self.assertTrue('a' in self.stopwatch.times('tick'))
self.assertEqual(self.stopwatch.time('tick', 'a'),
- self.stopwatch.times('tick')['a'])
-
+ self.stopwatch.times('tick')['a'])
+
now = datetime.datetime.now()
self.assertTrue(self.stopwatch.time('tick', 'a') < now)
@@ -53,12 +53,12 @@ class StopwatchTests(unittest.TestCase):
self.assertEqual(our_delta, watch_delta)
self.assertTrue(self.stopwatch.start_stop_seconds('start-stop') > 0)
-
+
def test_with(self):
with self.stopwatch('foo'):
pass
self.assertTrue(self.stopwatch.start_stop_seconds('foo') < 1.0)
-
+
def test_with_within_with(self):
with self.stopwatch('foo'):
with self.stopwatch('bar'):
@@ -69,4 +69,3 @@ class StopwatchTests(unittest.TestCase):
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)
-