Closed catriuspham closed 7 years ago
Can you give me a full piece of code @catriuspham?
@hieueastagile I found out the problem. nosetests
automatically runs through the test/__init__.py
which imports the chain_matcher
.
I don't really get it, could you give more code and explanation?
You can see that in tests/test_expect.py
we have a lot of tests that use chain matcher. And all tests pass when running nosetests
. Then I use ipython and run the exact same code from the line 29 in tests/test_expect.py
which is expect(expect).to.have.chain('to')
, and it raises AttributeError: 'expect' object has no attribute 'chain'
.
So I think this behavior is expected, the chain matcher is only available for testing purpose. It's a feature, not a bug :laughing:
Running this
expect(expect).to.have.chain('to')
in ipython returnsAttributeError
. But running the same code with nosetests still passes.