You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to be a regression introduced in 0.4.6.
Consider this code:
import chai
class Foo(object):
def foo(self):
pass
class MyTest(chai.Chai):
def testFoo(self):
obj = Foo()
self.expect(obj.foo).times(1)
As you can see, we never invoke obj.foo, so this test should fail. Yet, in Chai 0.4.6 it succeeds.
The culprit is the change in 0.4.6 to tear down stubs immediately after the test. Doing so clears stub._expectations – yet this also has the undesirable effect of clearing stub.unmet_expectations().
The text was updated successfully, but these errors were encountered:
This appears to be a regression introduced in 0.4.6.
Consider this code:
As you can see, we never invoke
obj.foo
, so this test should fail. Yet, in Chai 0.4.6 it succeeds.The culprit is the change in 0.4.6 to tear down stubs immediately after the test. Doing so clears
stub._expectations
– yet this also has the undesirable effect of clearingstub.unmet_expectations()
.The text was updated successfully, but these errors were encountered: