diff options
Diffstat (limited to 'testrepository/tests/commands/test_list_tests.py')
-rw-r--r-- | testrepository/tests/commands/test_list_tests.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/testrepository/tests/commands/test_list_tests.py b/testrepository/tests/commands/test_list_tests.py index eda9efa..76b9337 100644 --- a/testrepository/tests/commands/test_list_tests.py +++ b/testrepository/tests/commands/test_list_tests.py @@ -18,9 +18,7 @@ from io import BytesIO import os.path from subprocess import PIPE -from extras import try_import import subunit -v2_avail = try_import('subunit.ByteStreamToStreamResult') from testtools.compat import _b from testtools.matchers import MatchesException @@ -75,14 +73,11 @@ class TestCommand(ResourcedTestCase): def test_calls_list_tests(self): ui, cmd = self.get_test_ui_and_cmd(args=('--', 'bar', 'quux')) cmd.repository_factory = memory.RepositoryFactory() - if v2_avail: - buffer = BytesIO() - stream = subunit.StreamResultToBytes(buffer) - stream.status(test_id='returned', test_status='exists') - stream.status(test_id='values', test_status='exists') - subunit_bytes = buffer.getvalue() - else: - subunit_bytes = _b('returned\n\nvalues\n') + buffer = BytesIO() + stream = subunit.StreamResultToBytes(buffer) + stream.status(test_id='returned', test_status='exists') + stream.status(test_id='values', test_status='exists') + subunit_bytes = buffer.getvalue() ui.proc_outputs = [subunit_bytes] self.setup_repo(cmd, ui) self.set_config( @@ -103,14 +98,11 @@ class TestCommand(ResourcedTestCase): ui, cmd = self.get_test_ui_and_cmd( args=('returned', '--', 'bar', 'quux')) cmd.repository_factory = memory.RepositoryFactory() - if v2_avail: - buffer = BytesIO() - stream = subunit.StreamResultToBytes(buffer) - stream.status(test_id='returned', test_status='exists') - stream.status(test_id='values', test_status='exists') - subunit_bytes = buffer.getvalue() - else: - subunit_bytes = _b('returned\nvalues\n') + buffer = BytesIO() + stream = subunit.StreamResultToBytes(buffer) + stream.status(test_id='returned', test_status='exists') + stream.status(test_id='values', test_status='exists') + subunit_bytes = buffer.getvalue() ui.proc_outputs = [subunit_bytes] self.setup_repo(cmd, ui) self.set_config( |