diff options
author | Tomi Sarvela <tomi.p.sarvela@intel.com> | 2017-02-09 20:22:18 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2017-02-10 09:34:02 -0800 |
commit | dc2b80af49b2c9cc5c8cdac3824934e77df1cade (patch) | |
tree | 726bf68488eee767668371d02d901ac3c84ad8d3 /framework | |
parent | 748016cb43457574d6ede461ed975561bc1c9c56 (diff) |
framework/results.py: Copy 'tests' internally to OrderedDict
To preserve the original test running order, use OrderedDict
when copying 'tests' values over.
Reviewed-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/results.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/framework/results.py b/framework/results.py index 1a73c11b0..4cfe78250 100644 --- a/framework/results.py +++ b/framework/results.py @@ -350,7 +350,8 @@ class TestrunResult(object): if not self.totals: self.calculate_group_totals() rep = copy.copy(self.__dict__) - rep['tests'] = {k: t.to_json() for k, t in six.iteritems(self.tests)} + rep['tests'] = collections.OrderedDict((k, t.to_json()) + for k, t in six.iteritems(self.tests)) rep['__type__'] = 'TestrunResult' return rep @@ -378,8 +379,8 @@ class TestrunResult(object): if 'time_elapsed' in dict_: setattr(res, 'time_elapsed', TimeAttribute.from_dict(dict_['time_elapsed'])) - res.tests = {n: TestResult.from_dict(t) - for n, t in six.iteritems(dict_['tests'])} + res.tests = collections.OrderedDict((n, TestResult.from_dict(t)) + for n, t in six.iteritems(dict_['tests'])) if not 'totals' in dict_ and not _no_totals: res.calculate_group_totals() |