def test_not_to_fails(self): self.foo = 4 with self.assertRaises(ExpectationError): with expect.not_to(change, lambda: self.foo): self.foo = 6
def test_not_to_passes(self): self.foo = 4 with expect.not_to(change, lambda: self.foo): pass