Bugs: https://github.com/Ralph-Wang/should/issues More Details: https://github.com/Ralph-Wang/should/blob/master/README.md
pip install should
from should import it
# 一般的断言
it(1).should.be.int
it({}).should.be.no.ok
it(2).should.be.equal(2)
it(10).should.be.no.equal(8)
it([1,2,3]).should.contain(3)
# lambda 版异常断言
it(lambda: int('abc')).should.throw(ValueError)
it(lambda: int('123')).should.no.throw(ValueError)
- 更多例子请参考 tests
The MIT License