Skip to main content

Test-tools

Usage

Test files in project

/tests
    __init__.py
    /pkg1
        /fixtures
            foo1.json
            foo2.json
        __init__.py
        test1.py
    /pkg2
        /fixtures
            bar1.json
            bar2.json
        __init__.py
        test2.py

Content of “tests/pkg1/fixtures/foo1.json”:

{
    "blah1": [
        ["foo"],
        ["bar"],
        [1],
        [2],
        [true],
        [null]
    ],
    "blah2": [
        [-1234, 0],
        [3456, -2.345],
        [1, 1],
        [99999, false],
        [11, 789],
        [null, null]
    ]
}

Content of “tests/pkg1/test1”:

from unittest import TestCase

from test_tools import data_provider, FixtureManager

fx_man1 = FixtureManager()
fx_man1.load(fixture_file='foo1')

fx_man2 = FixtureManager()
fx_man2.load(fixture_file='foo2')


class MyTestCase(TestCase):
    @data_provider(fx_man1['blah1'])
    def test_my_cool_feature(self, param1):
        # some code
        pass

    @data_provider(fx_man1['blah2'])
    def test_my_cool_feature(self, param1, param2):
        # some code
        pass

    @data_provider(fx_man2['blah3'])
    def test_my_cool_feature(self, param):
        # some code
        pass

Metadata

Release files for test-tools 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for test-tools 0.0.3
File Size Uploaded Provenance Actions
test-tools-0.0.3.tar.gz 4.4 kB Without provenance Details for test-tools-0.0.3.tar.gz

Release files / test-tools-0.0.3.tar.gz

Download URL test-tools-0.0.3.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
946271aad70a05b4e2e49b312de6c7cd64264d2b7c85ade1b9bcbb8f0d243f7a
BLAKE2b-256 checksum
How to use checksums
40b97c5742f8c12ee7b182b77ccdcd47da9756557b11175433be4b02c49d9a15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for test-tools 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file No provenance

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page