Skip to content
Yoav Kleinberger edited this page Aug 21, 2021 · 3 revisions

Testix - a More Readable Mocking Framework for Python

Testix is a special mocking framework for writing unit tests in Python, designed to work well with pytest

Its purpose is to present a more rigorous and readable alternative to the standard mocking available from the Python standard library (unittest.mock).

Testix uses a concept of scenarios that exactly define the expected behaviour of the unit under test.

A Testix Scenario is a construct for enforcing the demands that the unit test makes of the code.

The immediate advatages of testix over unittest.mock are

  • With Testix, defining how the mocks are called and asserting that they actually were called that way is one and the same. Using unittest.mock these are two separate stages, one may easily forget to make some assertions.
  • Testix scenario specification is much more readable - it resembles the code itself.

We recommend that you

  1. start with the tutorial
  2. then move on to cover the advanced features.
Clone this wiki locally