fixes TypeError coercing of tempfile in subunit2json.py
Closes-Bug: #1343312 Change-Id: I9d86169de7dd69311fcf1478f0708a66834d5857
This commit is contained in:
@@ -137,7 +137,7 @@ class FileAccumulator(testtools.StreamResult):
|
|||||||
|
|
||||||
|
|
||||||
def main(subunit_log_file):
|
def main(subunit_log_file):
|
||||||
results_file, _ = tempfile.mkstemp()
|
fd, results_file = tempfile.mkstemp()
|
||||||
result = JsonOutput(results_file)
|
result = JsonOutput(results_file)
|
||||||
stream = open(subunit_log_file, 'rb')
|
stream = open(subunit_log_file, 'rb')
|
||||||
|
|
||||||
@@ -161,8 +161,8 @@ def main(subunit_log_file):
|
|||||||
suite = subunit.ProtocolTestCase(bytes_io)
|
suite = subunit.ProtocolTestCase(bytes_io)
|
||||||
suite.run(result)
|
suite.run(result)
|
||||||
result.stopTestRun()
|
result.stopTestRun()
|
||||||
with open(results_file, 'rb') as results_file:
|
with open(results_file, 'rb') as temp_results_file:
|
||||||
data = results_file.read()
|
data = temp_results_file.read()
|
||||||
try:
|
try:
|
||||||
os.unlink(results_file)
|
os.unlink(results_file)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
|
Reference in New Issue
Block a user