Skip to content

Commit

Permalink
twister: blackbox: coverage: fix matching pattern
Browse files Browse the repository at this point in the history
Fix the expected pattern randomly matched to coverage.json contents
ordered differently at test_coverage_basedir().

Signed-off-by: Dmitrii Golovanov <[email protected]>
  • Loading branch information
golowanow authored and nashif committed Oct 10, 2024
1 parent fc90c9f commit 27456ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/tests/twister_blackbox/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TestCoverage:
'coverage.log', 'coverage.json',
'coverage'
],
r'{"files": \[], "gcovr/format_version": ".*"}'
r'{"files": \[\], "gcovr/format_version": ".*"}'
),
]
TESTDATA_4 = [
Expand Down Expand Up @@ -244,7 +244,7 @@ def test_coverage_basedir(self, capfd, test_path, test_platforms, out_path, file
with open(path, "r") as json_file:
json_content = json.load(json_file)
pattern = re.compile(expected_content)
assert pattern.match(json.dumps(json_content))
assert pattern.match(json.dumps(json_content, sort_keys=True))
if os.path.exists(base_dir):
os.rmdir(base_dir)

Expand Down

0 comments on commit 27456ed

Please sign in to comment.