summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2011-02-10 17:46:01 +0000
committerJonathan Lange <jml@canonical.com>2011-02-10 17:46:01 +0000
commit273427a2f62b46c6e9e89ba5837a96684929c63c (patch)
treed2487ece203a4683572dd7d0eaf56fab68b7dea0 /python
parentd9936a42c5204813c56ac9dd361e4ce6545cbea0 (diff)
downloadsubunit-git-273427a2f62b46c6e9e89ba5837a96684929c63c.tar.gz
Return, rather than setting an attribute
Diffstat (limited to 'python')
-rw-r--r--python/subunit/tests/test_subunit_filter.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py
index 91f6f1f..34283a2 100644
--- a/python/subunit/tests/test_subunit_filter.py
+++ b/python/subunit/tests/test_subunit_filter.py
@@ -101,18 +101,18 @@ class TestTestResultFilter(unittest.TestCase):
self.assertEqual(1, self.filtered_result.testsRun)
def run_tests(self):
- self.setUpTestStream()
- self.test = subunit.ProtocolTestCase(self.input_stream)
+ input_stream = self.getTestStream()
+ self.test = subunit.ProtocolTestCase(input_stream)
self.test.run(self.filter)
- def setUpTestStream(self):
+ def getTestStream(self):
# While TestResultFilter works on python objects, using a subunit
# stream is an easy pithy way of getting a series of test objects to
# call into the TestResult, and as TestResultFilter is intended for
# use with subunit also has the benefit of detecting any interface
# skew issues.
- self.input_stream = StringIO()
- self.input_stream.write("""tags: global
+ input_stream = StringIO()
+ input_stream.write("""tags: global
test passed
success passed
test failed
@@ -127,7 +127,8 @@ skip skipped
test todo
xfail todo
""")
- self.input_stream.seek(0)
+ input_stream.seek(0)
+ return input_stream
def test_suite():