Automatically test your functions to see if you have changed their behavior by mistake!
Project description
AutoTest!Reg
Automatically test your functions to see if you have changed their behavior by mistake!
View Demo
·
Report Bug
About The Project
Have you ever spent hours reworking someone else's code, trying not to break anything, only to realize at the last moment that something doesn't work anymore, but not knowing at which step you introduced the bug? So frustrating!
AutoTest!Reg allows you to automatically track the code you are working on and not introduce any regression, without writing a single test!
Getting Started
Using AutoTest!Reg requires no effort at all!
Install AutoTest!Reg with pip :
pip install autotestreg
Import AutoTest!Reg into your tests, adding this line:
import autotestreg
To follow a function my_func
, this code is all you need:
from autotestreg import autotest_func
def my_func():
...
autotest_func(my_func)
To track an entire module mypackage
, with all the functions and methods it contains:
from autotestreg import autotest_module
import mypackage
autotest_module(mypackage)
Next
If no regression was introduced when you modified the code, your tests will pass.
Otherwise, AutoTest!Reg will give you the function whose behavior was changed.
Advanced usage
You can use AutoTest!Reg as a pre-commit hook:
- Create some test files using
autotestreg
(e.g.some_tests.py
)
- This file must contain at the top
from autotestreg import set_interactive
andset_interactive(False)
- Modify the pre-commit hook script:
touch .git/hooks/pre-commit
- Add this inside:
#!/bin/sh
# Dont forget to activate your env if needed.
python some_tests.py
- Make the pre-commit file executable:
chmod +x .git/hooks/pre-commit
Contributing
(Section in english)
I want to add a lot of functionnalities to this project, but I don't have much time to work on it. Contributions are welcome!
To install in dev mode, use pip install -e .
Roadmap/todo
Task | Importance | Difficulty | Contributor on it | Description |
---|---|---|---|---|
./5 | ./5 | NOBODY | e.g. : ... |
Non-Code contribution :
Task | Importance | Difficulty | Contributor on it | Description |
---|---|---|---|---|
./5 | ./5 | NOBODY | e.g. : ... |
For every todo, just click on the link to find the discussion where I describe how I would do it.
See the open issues for a full list of proposed features (and known issues).
How to contribute
Contributing is an awesome way to learn, inspire, and help others. Any contributions you make are greatly appreciated, even if it's just about styling and best practices.
If you have a suggestion that would make this project better, please fork the repo and create a pull request.
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/YourAmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Authors
This library was created by Nicolas MICAUX.
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
File details
Details for the file autotestreg-0.2.1.tar.gz
.
File metadata
- Download URL: autotestreg-0.2.1.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00bb37ed44750ad9def101a56e7059ad60d7153a064e13de08af11f2f8c998f9 |
|
MD5 | 804273fc9c2710b90b7a1fa8fe67cb3f |
|
BLAKE2b-256 | 4db2c941ba051d5beb7bf24d804d1f8118e7404437af85eb3debdc0a532bb2b6 |