Skip to content

Commit d1df873

Browse files
committed
Exclude non-english license rules from validation
As they are not included in the standard indexing, they cannot be detected unless we reindex. Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 6b2a7f5 commit d1df873

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/licensedcode/test_detection_validate.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from licensedcode import models
2222
from scancode_config import REGEN_TEST_FIXTURES
2323

24-
2524
"""
2625
Validate that each license and rule text is properly detected with exact
2726
detection and that their ignorable clues are correctly detected.
@@ -144,8 +143,7 @@ def check_ignorable_clues(licensish, regen=REGEN_TEST_FIXTURES, verbose=False):
144143
models.set_ignorables(licish, result , verbose=verbose)
145144
licish.dump()
146145
if is_from_license:
147-
licensish= models.build_rule_from_license(licish)
148-
146+
licensish = models.build_rule_from_license(licish)
149147

150148
expected = models.get_normalized_ignorables(licensish)
151149

@@ -194,6 +192,10 @@ def build_validation_tests(rules, test_classes, regen=REGEN_TEST_FIXTURES):
194192

195193
for chunk, cls in zip(chunks, test_classes):
196194
for rule in chunk:
195+
# we exclude the non-english rules from validation
196+
# as they are not included in the standard indexing
197+
if rule.language != 'en':
198+
continue
197199
if rule.text_file and os.path.exists(rule.text_file):
198200
test_name = (
199201
'test_validate_detect_' +

0 commit comments

Comments
 (0)