a simple and readable python testing tool
Project description
TurboTest๐ฅ (still under dev)
let's make tests readable and simple
Give it a try
import TurboTest as tt
from my_module.my_function import my_function
def basic_operations():
result = my_function(2, 3)
expected = 5
tt.both_are_equal(result, expected)
def should_raise_AssertionError_for_input_less_than_25():
with tt.these_will_raise(AssertionError) as its: my_function(21)
tt.both_are_equal(its.exception_msg, "Invalid: Value is less than 25.")
What you will get:
TurboTest... at '/path/to/my_module' (Monday, Jan 1, 2024, 13:11:21 UTC-0800)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[22:00:00] PASS: my_function: basic operation (3๐งช|1m2.3s)
[22:00:02] PASS: my_function: should raise AssertionError for input less than 25 (9๐งช|2m2.1s)
[22:02:00] FAIL: abc123/foo/bar: should do X (2๐งช|0m5.1s)
[22:03:00] FAIL: abc123/foo/bar: reject empty string (17๐งช|0m0.1s)
[22:05:12] PASS: xyz/abc: exit if X equal to None (9๐งช|0m0.7s)
[22:07:45] FAIL: xyz/pqr: return None if Y does not exist (6๐งช|2m3.1s)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Done @ 22:09:55, 100 test functions [pass/fail: 61/39] executed in [core/total: 31m2.0s/37m3.1s] ๐ฅ๐ฅ
with color:
[]
Install
-
via PyPI, run this:
pip install turbotest
Misc
Troubleshoot
- Please note that TurboTest minimizes validations for readability and easier maintenance purposes. The input should align with the function's expectations. For example, if the function specifies
x: Exception
, please provide only exception-related input, as there are no checks to catch incorrect inputs.
License
This project's source code and documentation are under the MIT license.
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
TurboTest-0.12.0b0.tar.gz
(9.6 kB
view details)
Built Distribution
File details
Details for the file TurboTest-0.12.0b0.tar.gz
.
File metadata
- Download URL: TurboTest-0.12.0b0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d91d113000521f211973164f1030b12f8dbee2f2ac5ff9cdc59e87fd1af3a3 |
|
MD5 | 588b984ca0da26de4e7b545dc668fad5 |
|
BLAKE2b-256 | 0e091318135524f6d6e5a8bfb5db52b972b2df02939de0dc248c417770257fd7 |
File details
Details for the file TurboTest-0.12.0b0-py3-none-any.whl
.
File metadata
- Download URL: TurboTest-0.12.0b0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afda567573c635987440dd5304fd56ee87ec22288803cb65dbf70deedf3dce27 |
|
MD5 | 239f14a4e1d670022fc65de7646b3ee9 |
|
BLAKE2b-256 | c472d9fb0607778ae2f0975c1b1719fdd827590fc6953871b50aa46248a8ac6c |