delayed-assert
delayed-assert copied to clipboard
how to instantiate a delayed assert
Hi, is there a way to instantiate a delayed assert, or in some other way have multiple assertions accumulating expectations at the same time? What I was imagining was the ability to do something like this, but with da
being non-global.
da = some_function()
da.expect(2 == 4, "another checkpoint")
da.assert_expectations()
def some_function():
delayed_assert = DelayedAssert()
delayed_assert.expect(1 == 1, "checkpoint related to some_function")
delayed_assert.expect(1 == 2, "another checkpoint related to some function")
return delayed_assert
Hi @pr4bh4sh Using delayed assert
- it does not gives a concrete message upon exception when failed
- You should remove the method name starts from "test". This is not needful