Merge "Make subprocess outputs to text for Python 3"
This commit is contained in:
commit
158b2506b7
@ -20,7 +20,7 @@ import subprocess
|
||||
def _get_test_list(regex, env=None):
|
||||
env = env or copy.deepcopy(os.environ)
|
||||
proc = subprocess.Popen(['testr', 'list-tests', regex], env=env,
|
||||
stdout=subprocess.PIPE)
|
||||
stdout=subprocess.PIPE, universal_newlines=True)
|
||||
out = proc.communicate()[0]
|
||||
raw_test_list = out.split('\n')
|
||||
bad = False
|
||||
|
@ -168,3 +168,9 @@ regex_b"""
|
||||
|
||||
expected_regex = 'regex_a|regex_b'
|
||||
self.assertEqual(result, expected_regex)
|
||||
|
||||
|
||||
class TestGetTestList(base.TestCase):
|
||||
def test__get_test_list(self):
|
||||
test_list = os_testr._get_test_list('test__get_test_list')
|
||||
self.assertIn('test__get_test_list', test_list[0])
|
||||
|
Loading…
x
Reference in New Issue
Block a user