Skip to main content

Hamcrest matchers for mock objects.

Project description

matchmock

PyPI Version Build Status Coverage Status

Hamcrest matchers for mock objects.

Starting from version 2.0.0 python2 is no longer supported the 1.x series will remain supported but no new features will be added.

Example

    f = Mock()
    f.method('foo', 'bar')

    assert_that(f.method, called_once_with(anything(), 'bar')

Matchers

  • called - match mock that was called one or more times
  • not_called - match mock that was never called
  • called_once - match mock that was called once regardless of arguments
  • called_with - match mock has at least one call with the specified arguments
  • called_once_with - match mock that was called once and with the specified arguments
  • called_n_times - match mock that was called number of times.

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

matchmock-2.0.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

matchmock-2.0.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

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