skip to navigation
skip to content

doublex 1.8.4

Python test doubles

Powerful test doubles framework for Python

[ install | docs | changelog | sources | issues | PyPI | buildbot ]

a trivial example

import unittest
from doublex import Spy, assert_that, called

class SpyUseExample(unittest.TestCase):
    def test_spy_example(self):
        # given
        spy = Spy(SomeCollaboratorClass)
        cut = YourClassUnderTest(spy)

        # when

        # then
        assert_that(spy.some_method, called())

See more about doublex doubles.


  • doubles have not public API framework methods. It could cause silent misspelling.
  • doubles do not require collaborator instances, just classes, and it never instantiate them.
  • assert_that() is used for ALL assertions.
  • mock invocation order is relevant by default.
  • supports old and new style classes.
  • supports Python versions: 2.6, 2.7, 3.2, 3.3, 3.4


  • official package (may be outdated)
  • amateur repository: deb sid main (always updated)
  • official ubuntu package
  • debian dir: svn://
File Type Py Version Uploaded on Size
doublex-1.8.4.tar.gz (md5) Source 2016-11-09 13KB