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.

Files for testcase, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size testcase-0.1.0-py3-none-any.whl (2.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size testcase-0.1.0.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page