Skip to main content

testcase

Run tabular unit tests.

Support

It has been tested with unittest.TestCase. Basically it will work with any class that implements:

  • assertEqual(x, y)
  • assertRaises(t) with __enter__ and __exit__ handlers for with.

Example

import unittest
import testcase


def foo(x, y):
    return x / y


class FooTest(unittest.TestCase):
    def test_foo(self):
        testcase.runall(self, foo, [
            testcase.new(
                name='1 / 1 = 1',
                args=(1, 1),
                expect=1),
            testcase.new(
                name='raises ZeroDivisionError',
                args=(1, 0),
                raises=ZeroDivisionError),
        ])


if __name__ == '__main__':
    unittest.main()

Metadata

Release files for testcase 0.1.0

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

Source distribution (sdist)

Source distribution for testcase 0.1.0
File Size Uploaded
testcase-0.1.0.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for testcase 0.1.0
File Interpreter ABI Platform
testcase-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.5 kB

Release files / testcase-0.1.0.tar.gz

Download URL testcase-0.1.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
078a3e94ef7918934c3ac51a839daaaa32eca2406452c6dbc06225d2a656d100
BLAKE2b-256 checksum
How to use checksums
b565cba75f737c1642e9bd0057fa0ed31e9597ae8310e03f271f074cfd1fe73f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / testcase-0.1.0-py3-none-any.whl

Download URL testcase-0.1.0-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da027ded9674259ab241b20beb45b01fa60d550fa78db89aef1c6b7e53996c5e
BLAKE2b-256 checksum
How to use checksums
c222d698087f316350836ca8e4671462dc06aeb22072741d0749480be8bd4b1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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