Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidvilla/python-doublex
Python test doubles library
https://github.com/davidvilla/python-doublex
Last synced: 22 days ago
JSON representation
Python test doubles library
- Host: GitHub
- URL: https://github.com/davidvilla/python-doublex
- Owner: davidvilla
- License: gpl-3.0
- Created: 2018-07-24T10:43:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T06:49:50.000Z (3 months ago)
- Last Synced: 2024-12-14T05:41:30.789Z (28 days ago)
- Language: Python
- Homepage: https://pypi.org/project/doublex/
- Size: 373 KB
- Stars: 11
- Watchers: 5
- Forks: 8
- Open Issues: 8
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/doublex.png
:target: http://pypi.python.org/pypi/doublex
:alt: Latest PyPI version.. image:: https://img.shields.io/pypi/l/doublex.png?maxAge=2592000
:alt: License.. image:: https://img.shields.io/pypi/pyversions/doublex.png?maxAge=2592000
:target: http://pypi.python.org/pypi/doublex
:alt: Supported Python Versions.. image:: https://github.com/DavidVilla/python-doublex/actions/workflows/tests.yml/badge.svg
:target: https://github.com/DavidVilla/python-doublex
:alt: GitHub Actions CI statusPowerful test doubles framework for Python
[
`install `_ |
`docs `_ |
`changelog `_ |
`sources `_ |
`issues `_ |
`PyPI `_ |
`github `_
]a trivial example
-----------------.. sourcecode:: python
import unittest
from doublex import Spy, assert_that, calledclass 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: 3.6, 3.7, 3.8, 3.9, 3.10**Debian
^^^^^^* amateur repository: ``deb https://uclm-arco.github.io/debian sid main`` (always updated)
* `official package `_ (may be outdated)
* `official ubuntu package `_
* debian dir: ``svn://svn.debian.org/svn/python-modules/packages/doublex/trunk``related
-------* `pyDoubles `_
* `doublex-expects `_
* `crate `_
* `other doubles `_
* `ludibrio `_
* `doubles `_.. Local Variables:
.. coding: utf-8
.. mode: rst
.. mode: flyspell
.. ispell-local-dictionary: "american"
.. fill-columnd: 90
.. End: