summaryrefslogtreecommitdiff
path: root/morphlib/stopwatch_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* python scripts: pep8ize codebaseRichard Maw2012-08-011-9/+8
| | | | | | | | | 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.
* Remove unnecessary unittest tearDown methodLars Wirzenius2012-02-271-3/+0
|
* Bump copyright years, get rid of long lines and unused imports.Jannis Pohlmann2012-01-231-1/+1
|
* Get rid of assertIn, assertNotIn that are only available in Python 2.7.Jannis Pohlmann2012-01-191-8/+8
|
* Use self.assert* everywhere instead of the assert statement.Jannis Pohlmann2012-01-191-9/+9
|
* make a Stopwatch usable with the "with" statementLars Wirzenius2012-01-121-0/+17
| | | | | | | | | | | | | | | | | | This simplifies its use. Previously: w.start('foo') ... w.stop('foo') Now: with w('foo'): ... With "with", it is immediately clear from the code, and its indentation, what is being measured. With the old code, you have to hunt for the start and stop method calls.
* Add Stopwatch.start_stop_seconds(), don't use timedelta.total_seconds().Jannis Pohlmann2011-12-081-2/+2
| | | | | | | | | | | | | | | | | | This function is only available in Python >= 2.7. On http://docs.python.org/library/datetime.html#timedelta-objects it says total_seconds() is equal to (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 with true division enabled. We are using td.days * 24 * 3600 + td.seconds + operator.truediv(td.microseconds, 10**6) now in Stopwatch.start_stop_seconds(), which I find more readable.
* Use assertEqual and drop has_keys().Jannis Pohlmann2011-12-061-4/+4
|
* Make Stopwatch less ambiguous, add tests, update Builder.Jannis Pohlmann2011-12-061-0/+58