Expects¶
Expects is an expressive and extensible TDD/BDD assertion library for Python. Expects can be extended by defining new matchers.
Usage¶
Just import the expect
callable and the built-in matchers and start writing test assertions.
from expects import *
expect([]).to(be_empty)
expect(False).not_to(be_true)
expect({
'name': 'Jack',
'email': 'jack@example.com'
}).to(have_key('name', match('\w+')))
expect(str).to(have_property('split') & be_callable)
expect(lambda: foo).to(raise_error(NameError))
expect('Foo').to(equal('Bar') | equal('Foo'))
Contents¶
- Installation
- Matchers
- Aliases
- Custom Matchers
- 3rd Party Matchers
- Changes
- 0.7.2 (Jun 26, 2015)
- 0.7.1 (Jun 9, 2015)
- 0.7.0 (Mar 1, 2015)
- 0.6.2 (Dec 10, 2014)
- 0.6.1 (Nov 30, 2014)
- 0.6.0 (Nov 24, 2014)
- 0.5.0 (Sep 20, 2014)
- 0.4.2 (Ago 16, 2014)
- 0.4.1 (Ago 16, 2014)
- 0.4.0 (Ago 15, 2014)
- 0.3.0 (Jun 29, 2014)
- 0.2.3 (Jun 4, 2014)
- 0.2.2 (May 20, 2014)
- 0.2.1 (Mar 22, 2014)
- 0.2.0 (Feb 5, 2014)
- 0.1.1 (Ago 20, 2013)
- 0.1.0 (Ago 11, 2013)