Should verify() not clear the expectations?

Issue #11 wontfix
Former user created an issue

When calling fudge.verify(), the calls are cleared for the fake but not the expectations. This means that you need to call fudge.clear_expectations() in your tearDown() to not disrupt other tests.

Since fudge.verify() already calls self.clear_calls(), should it not also call self.clear_expectations()? Is there a reason not to do it then?

Comments (1)

  1. Kumar McMillan repo owner

    Yeah, the reason not to call clear_expectations() is that I generally re-use the same mock instance between tests. It's sort of clumsy and is a source of confusion, I agree. Maybe someone can think of a better way.

  2. Log in to comment