Skip to main content

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

  1. Install Punic: pip install punictest

  2. Write your tests using the assert_ method:

from punic import Punic

p = Punic()
p.assert_(4, lambda: 2 + 2, "Addition")
  1. 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.

Metadata

Release files for punictest 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for punictest 0.1.1
File Size Uploaded
punictest-0.1.1.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for punictest 0.1.1
File Interpreter ABI Platform
punictest-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / punictest-0.1.1.tar.gz

Download URL punictest-0.1.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0706b413091ae80dd29cde40738a297e729163effb23669ae0418b2a015e17a1
BLAKE2b-256 checksum
How to use checksums
306814a2fcbcb30b97e198481244ea375e02514131866adf7aa7b69fd4fbc7f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / punictest-0.1.1-py3-none-any.whl

Download URL punictest-0.1.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c1b06f9ed56ae8d5eab308c37a04221b4e8c48d1e3a19908cb128a2a4b97a45
BLAKE2b-256 checksum
How to use checksums
0a32e1dc4f04552ad5cceb38b911a6c0d416a0ee5ee13390fc1c7723e8a852c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page