Skip to main content

Run tabular unit tests

Project description

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()

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

testcase-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

testcase-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file testcase-0.1.0.tar.gz.

File metadata

  • Download URL: testcase-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for testcase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 078a3e94ef7918934c3ac51a839daaaa32eca2406452c6dbc06225d2a656d100
MD5 937a68d08898eac3355943a2f9222a65
BLAKE2b-256 b565cba75f737c1642e9bd0057fa0ed31e9597ae8310e03f271f074cfd1fe73f

See more details on using hashes here.

File details

Details for the file testcase-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for testcase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da027ded9674259ab241b20beb45b01fa60d550fa78db89aef1c6b7e53996c5e
MD5 f375b43c099b76acac2fa4d992f3b12e
BLAKE2b-256 c222d698087f316350836ca8e4671462dc06aeb22072741d0749480be8bd4b1c

See more details on using hashes here.

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