GithubHelp home page GithubHelp logo

mgorny / python-doublex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidvilla/python-doublex

0.0 1.0 0.0 349 KB

Python test doubles library

Home Page: https://pypi.org/project/doublex/

License: GNU General Public License v3.0

Shell 0.20% Python 78.69% TeX 6.70% Makefile 3.57% HTML 10.83%

python-doublex's Introduction

Latest PyPI version

License

Supported Python Versions

GitHub Actions CI status

Powerful test doubles framework for Python

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

a trivial example

python

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: 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

python-doublex's People

Contributors

davidvilla avatar davidparsson avatar tobni avatar pasku avatar eferro avatar sbraz avatar magmax avatar oscaracena avatar angelsanz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.