Skip to main content

Auxiliary library for writing tests

Project description

Coverage Status Total alerts Language grade: Python

vutils-testing: Auxiliary library for writing tests

This package provides a set of functions and classes shared across various repositories within test code.

Installation

To install the package, type

$ pip install vutils-testing

Usage

Following code snippets demonstrate how to use the package.

The method TestCase.assert_called_with asserts that the mock object has been called once with the specified arguments and then resets it:

import unittest.mock

from vutils.testing import TestCase

class ExampleTestCase(TestCase):
    def test_assert_called_with(self):
        mock = unittest.mock.Mock()

        mock.foo(1, 2, bar=3)
        self.assert_called_with(mock, 1, 2, bar=3)

        mock.foo(4)
        self.assert_called_with(mock, 4)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vutils-testing-0.1.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

vutils_testing-0.1.0-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page