Skip to content

Commit

Permalink
print which theoryids are duplicate in scalevar test
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyStegeman committed Nov 26, 2024
1 parent c2c2d00 commit db01fac
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from collections import Counter
import importlib.resources as resources

import pytest
from ruamel.yaml import YAML

import validphys.scalevariations
Expand All @@ -15,4 +17,7 @@ def test_unique_theoryid_variations():
with file_path.open("r") as file:
data = yaml.load(file)
thids = [k["theoryid"] for k in data["scale_variations_for"]]
assert len(thids) == len(set(thids))
counter = Counter(thids)
duplicates = [item for item, count in counter.items() if count > 1]
if duplicates:
pytest.fail(f"scalevariationtheoryids.yaml multiple entries for theoryIDs: {duplicates}")

0 comments on commit db01fac

Please sign in to comment.