https://github.com/ajzaff/testcase
Run tabular unit tests
https://github.com/ajzaff/testcase
minimal tabular testing unit-testing utility
Last synced: 5 months ago
JSON representation
Run tabular unit tests
- Host: GitHub
- URL: https://github.com/ajzaff/testcase
- Owner: ajzaff
- License: apache-2.0
- Created: 2018-06-14T04:41:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-14T04:45:20.000Z (about 8 years ago)
- Last Synced: 2025-09-22T22:45:06.965Z (9 months ago)
- Topics: minimal, tabular, testing, unit-testing, utility
- Language: Python
- Homepage: https://pypi.org/project/testcase/
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```python
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()
```