~lifeless/subunit/streamresult

« back to all changes in this revision

Viewing changes to filters/subunit-notify

  • Committer: Robert Collins
  • Date: 2013-03-03 09:28:51 UTC
  • Revision ID: robertc@robertcollins.net-20130303092851-nq92ok7lyixaf73r
Port existing filters to v2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import pygtk
20
20
pygtk.require('2.0')
21
21
import pynotify
 
22
from testtools import StreamToExtendedDecorator
22
23
 
23
24
from subunit import TestResultStats
24
25
from subunit.filters import run_filter_script
28
29
 
29
30
 
30
31
def notify_of_result(result):
 
32
    result = result.decorated
31
33
    if result.failed_tests > 0:
32
34
        summary = "Test run failed"
33
35
    else:
41
43
    nw.show()
42
44
 
43
45
 
44
 
run_filter_script(TestResultStats, __doc__, notify_of_result)
 
46
run_filter_script(
 
47
    lambda output:StreamToExtendedDecorator(TestResultStats(output)),
 
48
    __doc__, notify_of_result, protocol_version=2)