Skip to content

Commit fdc9543

Browse files
committed
Merge pull request lisa-lab#413 from lamblin/fix_test_op_no_input
In filter, raise TypeError or ValueError.
2 parents 84ac684 + a9a8ff2 commit fdc9543

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

theano/gof/tests/test_op.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def __repr__(self):
3939
def filter(self, x, strict=False, allow_downcast=None):
4040
# Dummy filter: we want this type to represent strings that
4141
# start with `self.thingy`.
42-
assert isinstance(x, basestring) and x.startswith(self.thingy)
42+
if not isinstance(x, basestring):
43+
raise TypeError("Invalid type")
44+
if not x.startswith(self.thingy):
45+
raise ValueError("Invalid value")
4346
return x
4447

4548
class MyOp(Op):

0 commit comments

Comments
 (0)