Skip to main content

FlexMock provides a mock/stub/spy library for Python.

It is inspired by Ruby’s FlexMock, however full feature parity with the Ruby version is not a goal. Python FlexMock omits a number of things in the Ruby version, mainly various shortcuts for existing functionality, and implements a number of things that Ruby’s FlexMock doesn’t support, such as proxying/spying and matching arguments using their classes in addition to values.

What makes FlexMock unique in the Python testing world is its automatic integration with the test runner, allowing for really terse syntax and avoiding both the action->assertion and record->replay paradigms supported by all the other Python mocking libraries currently available. To be sure, you can still write your assertions in the action->assertion mode using FlexMock, but its powerful syntax allows you to define both the expectation and the assertion at the same time.

SUPPORTS:

  • test runner integration, i.e. automatic expectation checking on tearDown

  • advanced argument matching, including matching types and user-defined classes

  • expectations on number of times called, including at_least/at_most

  • mocks returning custom values, including different values on successive invokations

  • mocks raising custom exceptions

  • simple syntax for generating new mock objects

  • overriding new instances (on new-style objects)

  • parameter shortcuts for even terser syntax

  • proxying/spying using the and_execute expectation modifier

  • mocking a generator using and_yield

  • enforcing expectations ordering

Documentation:

https://github.com/has207/flexmock/wiki/Documentation

Changelog:

https://github.com/has207/flexmock/blob/master/CHANGELOG

Release files for flexmock 0.6.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flexmock 0.6.6
File Size Uploaded
flexmock-0.6.6.tar.gz 6.0 kB Details

Release files / flexmock-0.6.6.tar.gz

Download URL flexmock-0.6.6.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
65b86f3103a5882accffce2e65c528b4d5fddc88fdf5e1917766a94245c0e42d
BLAKE2b-256 checksum
How to use checksums
e928e75521a9980eabd8269969f87da33b306d3d552e134c5f654cee943e3ef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.13.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.3

2 release files

0.10.10

1 release file

0.10.9

1 release file

0.10.8

1 release file

0.10.7

1 release file

0.10.6

1 release file

0.10.5

1 release file

0.10.4

1 release file

0.10.3

1 release file

0.10.2

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.4.2

1 release file

0.7.4.1

1 release file

0.7.4

1 release file

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.9

1 release file

0.6.8

1 release file

0.6.7

1 release file

This release

0.6.6 This release

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page