Simple unit testing for python
Project description
Punic
Punic is a lightweight and user-friendly unit testing framework for Python. It provides an easy and efficient way to write and execute tests for your Python code.
Features
-
Easy Integration: Punic can be easily integrated into your Python projects.
-
Simple Assertion: The framework provides an
assert_
method for making assertions on expected and actual values. -
Output Formatting: Test results are displayed in a clear and readable format.
-
Customizable: Punic is flexible and customizable to suit your specific requirements.
Getting Started
-
Install Punic:
pip install punictest
-
Write your tests using the
assert_
method:
from punic import Punic
p = Punic()
p.assert_(4, lambda: 2 + 2, "Addition")
- Run your test program.
Reference
The Punic class provides methods for defining and executing tests, configuring behavior, and callbacks:
assert_(assertion, function, named="Unnamed")
: Defines a test case.
exit_on_failure(on_exit)
: Configures whether the program should exit on a test failure.
when_failed(action)
: Sets a callback function to be executed when a test case fails.
when_passed(action)
: Sets a callback function to be executed when a test case passes.
Contributions
Contributions to Punic are welcome! Please open an issue or submit a pull request for bug fixes, new features, or enhancements.
License
Punic is released under the MIT License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for punictest-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c1b06f9ed56ae8d5eab308c37a04221b4e8c48d1e3a19908cb128a2a4b97a45 |
|
MD5 | 2fe0daa82eb30c167b99d9ca04a3dfe3 |
|
BLAKE2b-256 | 0a32e1dc4f04552ad5cceb38b911a6c0d416a0ee5ee13390fc1c7723e8a852c6 |