diff options
-rw-r--r-- | framework/backends/junit.py | 6 | ||||
-rw-r--r-- | unittests/framework/backends/test_junit.py | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/framework/backends/junit.py b/framework/backends/junit.py index 4c9b7afa9..018cecd2b 100644 --- a/framework/backends/junit.py +++ b/framework/backends/junit.py @@ -29,6 +29,10 @@ try: from lxml import etree except ImportError: import xml.etree.cElementTree as etree +try: + import simplejson as json +except ImportError: + import json import six @@ -396,7 +400,7 @@ def _load(results_file): result.time.end = float(line[len('time end: '):]) continue elif line.startswith('pid:'): - result.pid = int(line[len('pid: '):]) + result.pid = json.loads(line[len('pid: '):]) continue diff --git a/unittests/framework/backends/test_junit.py b/unittests/framework/backends/test_junit.py index 6bc9e6aa6..06892ca73 100644 --- a/unittests/framework/backends/test_junit.py +++ b/unittests/framework/backends/test_junit.py @@ -56,7 +56,7 @@ _XML = """\ <system-out>this/is/a/command\nThis is stdout</system-out> <system-err>this is stderr -pid: 1934 +pid: [1934] time start: 1.0 time end: 4.5 </system-err> @@ -152,7 +152,7 @@ class TestProtectedLoad(object): expected = textwrap.dedent("""\ this is stderr - pid: 1934 + pid: [1934] time start: 1.0 time end: 4.5""") assert result.tests[self.testname].err.strip() == expected @@ -163,7 +163,7 @@ class TestProtectedLoad(object): def test_pid(self, result): """backends.junit._load: pid is loaded correctly.""" - assert result.tests[self.testname].pid == 1934 + assert result.tests[self.testname].pid == [1934] class TestJUnitBackend(object): |