Powerful test doubles framework for Python
[ install | docs | changelog | sources | issues | PyPI | github clone ]
a trivial exampleimport 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.
Featuresdoubles 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
amateur repository: deb https://uclm-arco.github.io/debian sid main (always updated)
official package (may be outdated)
debian dir: svn://svn.debian.org/svn/python-modules/packages/doublex/trunk
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution File detailsDetails for the file doublex-1.9.6.1.tar.gz
.
48fbc633598eb913a6eb0c4694f8c040ba57bae9653d45643a84243e0c9f3268
MD5 a5e1446f72cefa02fc28a533ae1bc050
BLAKE2b-256 fe3d0edaecbafa90c19530739467a5dd02c8ebf9968201ab1ff15537ea98422f
See more details on using hashes here.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4