Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmet expectations are ignored #15

Closed
ods94065 opened this issue Dec 24, 2013 · 0 comments
Closed

Unmet expectations are ignored #15

ods94065 opened this issue Dec 24, 2013 · 0 comments

Comments

@ods94065
Copy link

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants