Merge lp://staging/~yellow/subunit/real-time into lp://staging/~subunit/subunit/trunk
Status: | Merged |
---|---|
Merged at revision: | 164 |
Proposed branch: | lp://staging/~yellow/subunit/real-time |
Merge into: | lp://staging/~subunit/subunit/trunk |
Diff against target: |
33 lines (+4/-6) 2 files modified
python/subunit/test_results.py (+1/-4) python/subunit/tests/test_subunit_filter.py (+3/-2) |
To merge this branch: | bzr merge lp://staging/~yellow/subunit/real-time |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange | Approve | ||
Review via email: mp+103701@code.staging.launchpad.net |
Description of the change
This change makes the TestResultFilter send all time calls through directly.
It was part of one approach to make the testrepository tests pass for bug 988481 (see also lp:~yellow/testrepository/bug988481).
testrepository had a class (also called TestResultFilter) that tried to have this same approximate behavior--that is, sending all time calls through. To implement, it subclassed subunit's TestResultFilter and then reached into the _buffered_calls while in the stopTest method to try and find the time calls. Because of use of the decorator pattern, this was fragile.
This change in subunit means that testrepository can use subunit's TestResultFilter directly, thereby getting rid of the fragility associated with the combination of subclassing, decorating, and accessing a protected attribute.
It also has the possibly irrelevant advantage over the existing implementation that, when filtering live streams, the time calls come through also "live," at the expected time (assuming processing time is 0).
Tests pass, with the minimal test change describing the new behavior of the TestResultFilter itself.
This is work done by Benji York and Brad Crittenden; I'm just helping out with the MP.
I'm not 100% sure about this change, but I can't think of any actual use case for which this would be a regression.