ThreadsafeForwardingResult does not forward time outside of tests

Bug #885321 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Triaged
Medium
Unassigned

Bug Description

ThreadsafeForwardingResult does not forward time outside of tests, as this test demonstrates:

    def test_time_going_through_threadsafe_filter(self):
        # ThreadsafeForwardingResult discards time() output that is not bound
        # specifically to the start or end of a test.
        result = TestResult()
        filtered = ThreadsafeForwardingResult(result, Semaphore(1))
        filtered.startTestRun()
        filtered.time(datetime(2011, 1, 1, 0, 0, 1))
        filtered.startTest(self)
        filtered.time(datetime(2011, 1, 1, 0, 0, 2))
        filtered.addSuccess(self)
        # This will be ignored.
        filtered.time(datetime(2011, 1, 1, 0, 0, 3))
        filtered.stopTest(self)
        filtered.stopTestRun()
        self.assertEqual(datetime(2011, 1, 1, 0, 0, 3), result._now())

This makes the resulting stream of events slightly less valuable for time analysis. In particular, it would be useful to have the very first time event and the very last time event for a particular stream.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.