Skip to content

Commit 18b2e9e

Browse files
golowanowgchwier
authored andcommitted
[nrf fromtree] twister: blackbox: coverage: fix matching pattern
Fix the expected pattern randomly matched to coverage.json contents ordered differently at test_coverage_basedir(). Signed-off-by: Dmitrii Golovanov <[email protected]> (cherry picked from commit 27456ed)
1 parent 437b905 commit 18b2e9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/tests/twister_blackbox/test_coverage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TestCoverage:
4646
'coverage.log', 'coverage.json',
4747
'coverage'
4848
],
49-
r'{"files": \[], "gcovr/format_version": ".*"}'
49+
r'{"files": \[\], "gcovr/format_version": ".*"}'
5050
),
5151
]
5252
TESTDATA_4 = [
@@ -243,7 +243,7 @@ def test_coverage_basedir(self, capfd, test_path, test_platforms, out_path, file
243243
with open(path, "r") as json_file:
244244
json_content = json.load(json_file)
245245
pattern = re.compile(expected_content)
246-
assert pattern.match(json.dumps(json_content))
246+
assert pattern.match(json.dumps(json_content, sort_keys=True))
247247
if os.path.exists(base_dir):
248248
os.rmdir(base_dir)
249249

0 commit comments

Comments
 (0)