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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file punictest-0.1.1.tar.gz.
File metadata
- Download URL: punictest-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0706b413091ae80dd29cde40738a297e729163effb23669ae0418b2a015e17a1
|
|
| MD5 |
655cdc441a7b5cbb86d22037c5cd3dc3
|
|
| BLAKE2b-256 |
306814a2fcbcb30b97e198481244ea375e02514131866adf7aa7b69fd4fbc7f3
|
File details
Details for the file punictest-0.1.1-py3-none-any.whl.
File metadata
- Download URL: punictest-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c1b06f9ed56ae8d5eab308c37a04221b4e8c48d1e3a19908cb128a2a4b97a45
|
|
| MD5 |
2fe0daa82eb30c167b99d9ca04a3dfe3
|
|
| BLAKE2b-256 |
0a32e1dc4f04552ad5cceb38b911a6c0d416a0ee5ee13390fc1c7723e8a852c6
|