summaryrefslogtreecommitdiff
path: root/python/subunit
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
commit42e3123b2d356cca2a99cd1719395f62ee58cdd7 (patch)
treed2487ece203a4683572dd7d0eaf56fab68b7dea0 /python/subunit
parentf39393556c5fa2a4f8dd2729fc6207bc7d229497 (diff)
downloadsubunit-42e3123b2d356cca2a99cd1719395f62ee58cdd7.tar.gz
Return, rather than setting an attribute
Diffstat (limited to 'python/subunit')
-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():