Merge lp:~gz/testtools/result_timings_forwarding_625594 into lp:~testtools-committers/testtools/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 101 | ||||
Proposed branch: | lp:~gz/testtools/result_timings_forwarding_625594 | ||||
Merge into: | lp:~testtools-committers/testtools/trunk | ||||
Diff against target: |
170 lines (+59/-43) 4 files modified
NEWS (+4/-0) testtools/testresult/real.py (+36/-42) testtools/tests/helpers.py (+4/-0) testtools/tests/test_testresult.py (+15/-1) |
||||
To merge this branch: | bzr merge lp:~gz/testtools/result_timings_forwarding_625594 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins | Approve | ||
Vincent Ladeuil | Approve | ||
Review via email: mp+36786@code.launchpad.net |
Description of the change
The testtools half of the fix for bug 625594, see <lp:~gz/bzr/use_testtools_timings_625594> for the bzr part.
ThreadsafeForwa
What we want to do is record and forward the relevant times subunit reports to the wrapped result, but I don't see a particularly pretty way of doing this. This change stashes the current stamp on the test case (which should be thread-local) when startTest is run, then retrieves it and reports it before startTest is forwarded, then forwards the now-current stamp before calling the add<Result> method.
Haven't really added sufficient test suite coverage here, and make the implementation tolerant of timestamps being given as the tests tend to call result methods out of sequence and expect sanity.
I welcome suggestions to make all this less horrid, and hope to dream some tonight.
thanks for poking at this.
Some random thoughts: setdefault( test), self._now()),
- an associative lookup (self.tests.
and pop that at the end
- self._test_started = (test, self._now)
-Rob