Skip to content

Commit

Permalink
refactor: change TypeError into ValueError, both in the validator and…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
damazter2 committed Sep 22, 2016
1 parent a153245 commit 5bcce8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qcodes/tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def test_divisors(self):
for v in self.multiples:
if v == 0:
continue
with self.assertRaises(TypeError):
with self.assertRaises(ValueError):
n.validate(v)

for v in self.not_multiples:
Expand Down
2 changes: 1 addition & 1 deletion qcodes/utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def __init__(self, divisor=1, **kwargs):
def validate(self, value, context=''):
super().validate(value=value, context=context)
if not value % self._divisor == 0:
raise TypeError('{} is not a multiple of {}; {}'.format(
raise ValueError('{} is not a multiple of {}; {}'.format(
repr(value), repr(self._divisor), context))

def __repr__(self):
Expand Down

0 comments on commit 5bcce8b

Please sign in to comment.