delayed-assert icon indicating copy to clipboard operation
delayed-assert copied to clipboard

how to instantiate a delayed assert

Open tbradley-sans opened this issue 5 years ago • 1 comments

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

tbradley-sans avatar Aug 29 '19 20:08 tbradley-sans

Hi @pr4bh4sh Using delayed assert

  1. it does not gives a concrete message upon exception when failed image
  2. You should remove the method name starts from "test". This is not needful

vishuhanda avatar May 08 '21 19:05 vishuhanda