def test_errstate(self): def foo(item): return "the callback called" table = Table([], [], []) seterrcall('empty', foo) self.assertNotEqual(geterr()['empty'], 'call') with errstate(empty='call'): result = errcheck(table) self.assertEqual(result, "the callback called") self.assertNotEqual(geterr()['empty'], 'call')
def test_geterr(self): state = geterr() self.assertEqual(state, runtime_ep._state) old = seterr(all='call') self.assertNotEqual(geterr(), state) seterr(**old)