No description, website, or topics provided.
Python HTML TeX Makefile Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
debian
docs
doctests
doublex
pydoubles-site
slides
.gitignore
.hgignore
.ian
.travis.yml
BUGS
CHANGES.rst
LICENSE
MANIFEST.in
README.rst
ToDo
doublex.svg
make
requirements.txt
setup.py
tox.ini
version.py

README.rst

Latest PyPI version

License

Supported Python Versions Travis CI status

Powerful test doubles framework for Python

[ install | docs | changelog | sources | issues | PyPI | github clone | travis ]

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
        cut.a_method_that_call_the_collaborator()

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

See more about doublex doubles.

Features

  • 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.3, 3.4, 3.5. 3.6, 3.7

Debian

  • official package (may be outdated)
  • amateur repository: deb http://pike.esi.uclm.es/arco/ sid main (always updated)
  • official ubuntu package
  • debian dir: svn://svn.debian.org/svn/python-modules/packages/doublex/trunk

related