Skip to content

Commit f490108

Browse files
committed
excluding TraitCompound and checking ir trait has requires or or
1 parent ef3688a commit f490108

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/checkspecs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,15 @@ def test_specs(self, uri):
274274
[uri, c, 'Inputs', traitname, 'mandatory=False'])
275275
# checking if traits that have default_value different that the trits default one
276276
# also have `usedefault` specified;
277+
# excluding TraitCompound
277278
# excluding Enum: always has default value (the first value)
278279
# excluding Tuple: takes tuple of inner traits default values as default, but doesn't use it
279280
# for Range assuming that if default == low, it's likely that usedefault should be False
280-
# (for Range traits takes low as a default default
281-
if trait.trait_type.__class__.__name__ not in ["Tuple", "Enum"]\
282-
and trait.default and "usedefault" not in trait.__dict__:
281+
# (for Range traits takes low as a default default
282+
if trait.trait_type.__class__.__name__ not in ['TraitCompound', "Tuple", "Enum"]\
283+
and trait.default and "usedefault" not in trait.__dict__\
284+
and "requires" not in trait.__dict__\
285+
and "xor" not in trait.__dict__:
283286
if trait.trait_type.__class__.__name__ is "Range"\
284287
and trait.default == trait.trait_type._low:
285288
continue

0 commit comments

Comments
 (0)