# HG changeset patch # User Olivier Delalleau # Date 1246049095 14400 # Node ID f84e6f301a18670fc8aaade8dff64ffad4281156 # Parent ba068f7d4d3ebecbc387d02694bb887d07a47ed0# Parent b6670cb571012011fee19111267e5e97e78e5fcb Merged diff -r b6670cb57101 -r f84e6f301a18 pylearn/algorithms/sandbox/test_cost.py --- a/pylearn/algorithms/sandbox/test_cost.py Fri Jun 26 10:46:45 2009 -0400 +++ b/pylearn/algorithms/sandbox/test_cost.py Fri Jun 26 16:44:55 2009 -0400 @@ -14,13 +14,19 @@ def test_float(self): """ - This should fail because we can't use floats in logfactorial + Ensure we cannot use floats in logfactorial. """ x = TT.as_tensor([0.5, 2.7]) o = cost.logfactorial(x) - f = T.function([],o) -# print repr(f()) - self.failUnless(numpy.all(f() == numpy.asarray([0., 0., 1.38629436, 3.29583687, 5.54517744, 8.04718956, 10.75055682, 13.62137104, 16.63553233, 19.7750212]))) + f = T.function([], o) + try: + f() + assert False + except TypeError, e: + if str(e).find(", must be int or long") >= 0: + pass + else: + raise class T_nlpoisson(unittest.TestCase): def test(self):