Skip to content

Commit 3abb7e7

Browse files
authored
Merge pull request #2999 from vkarak/bugfix/describe-show-reference
[bugfix] Show test references with `--describe` option
2 parents b7b9e3e + ee6307f commit 3abb7e7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

reframe/utility/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,9 @@ def __delitem__(self, key):
12751275
def __missing__(self, key):
12761276
raise KeyError(str(key))
12771277

1278+
def __rfm_json_encode__(self):
1279+
return self.data
1280+
12781281

12791282
@functools.total_ordering
12801283
class OrderedSet(collections.abc.MutableSet):

unittests/test_utility.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,6 @@ def test_scoped_dict_construction():
799799
'a': {'k1': 3, 'k2': 4},
800800
'b': {'k3': 5}
801801
}
802-
namespace_dict = reframe.utility.ScopedDict()
803802
namespace_dict = reframe.utility.ScopedDict(d)
804803

805804
# Change local dict and verify that the stored values are not affected
@@ -1088,6 +1087,17 @@ def test_scoped_dict_update():
10881087
assert scoped_dict == scoped_dict_alt
10891088

10901089

1090+
def test_scoped_dict_json_enc():
1091+
import json
1092+
1093+
d = {
1094+
'a': {'k1': 3, 'k2': 4},
1095+
'b': {'k3': 5}
1096+
}
1097+
ns_dict = reframe.utility.ScopedDict(d)
1098+
assert d == json.loads(jsonext.dumps(ns_dict))
1099+
1100+
10911101
def test_sequence_view():
10921102
l = util.SequenceView([1, 2, 2])
10931103
assert 1 == l[0]

0 commit comments

Comments
 (0)