def testCallPotentialFnMissingExtra(self): def potential(x): return x with self.assertRaisesRegexp(TypeError, 'A common solution is to adjust'): fun_mcmc.call_potential_fn(potential, 0.)
def testCallPotentialFn(self): def potential(x): return x, () x, extra = fun_mcmc.call_potential_fn(potential, 0.) self.assertEqual(0., x) self.assertEqual((), extra)