Skip to main content

Expressive and extensible TDD/BDD assertion library for Python

Project description

Latest version Docs License Number of PyPI downloads Build status

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'))

Installation

You can install the last stable release of Expects from PyPI using pip or easy_install.

$ pip install expects

Also you can install the latest sources from Github.

$ pip install -e git+git://github.com/jaimegildesagredo/expects.git#egg=expects

Specs

To run the Expects specs you should install the development requirements and then run mamba.

$ pip install -r test-requirements.txt
$ mamba

Changes

See Changes.

3rd Party Matchers

See 3rd-Party Matchers list.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

expects-0.8.0rc1.tar.gz (27.4 kB view details)

Uploaded Source

File details

Details for the file expects-0.8.0rc1.tar.gz.

File metadata

  • Download URL: expects-0.8.0rc1.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for expects-0.8.0rc1.tar.gz
Algorithm Hash digest
SHA256 3822d470c3bebe749928e360e7bfdecf0ac6541717040de31cb265f1372dfb43
MD5 4ab0c5e9eb6ecd84fc306a29c99d2290
BLAKE2b-256 1076a55920b212f7536a08b006914fc9ac279525eeddf8e1ed4d60b7f41adfa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page