Germinette is a modern, lightweight Python testing tool designed to automate the evaluation of 42 school Python projects. Inspired by tools like output-matching testers, Germinette helps you verify your exercises with robust checks, clear feedback, and a touch of style.
- Auto-Detection: Automatically identifies which module to test based on your file structure.
- Strict Testing:
- Logic: Runs multiple test cases (standard inputs, edge cases, type checks).
- Style (New): Enforces
flake8compliance. If style fails, testing stops immediately ("Single KO Policy") to prevent confusion. - Execution: Verifies that your scripts run exactly as shown in the subject PDF examples.
- Docstrings: Enforces docstrings on all classes and methods (Strict policy for Module 01).
- Maintenance:
- Auto-Cleanup: Automatically wipes
__pycache__directories after every run to keep your workspace pristine.
- Auto-Cleanup: Automatically wipes
- Detailed Error Reporting:
- Silent Checks: Style checks run quietly.
- Final Report: All errors (logic and style) are consolidated in a detailed report at the end.
- Context: Input context provided for every failure (know exactly what input broke your code).
- Global Updater:
germinette -uworks from anywhere, automatically finding and updating your local Germinette repository. - Rich Output: Beautiful, color-coded terminal output using the
richlibrary. - Recursion & Depth Checks: Detects infinite recursion or stack overflows.
| Module | Status | Features |
|---|---|---|
| Module 00 | π’ Ready | Basic Python, Functions, I/O |
| Module 01 | π’ Ready | Classes, Objects, Strict Docstrings |
| Module 02 | π’ Ready | Error Handling, Custom Exceptions |
| Module 03 | π’ Ready | sys.argv, Data Structures, Generators |
| Module 04 | π’ Ready | File Manipulation, Context Managers, Stdin/out |
| Module 05 | π’ Ready | ABCs, Protocols, Duck-typing |
| Module 06 | π’ Ready | Alembic Scripts, Package Management, Imports |
| Module 07 | π’ Ready | Abstract Factories, Strategies, Capabilities |
| Module 08 | π’ Ready | Virtual Environments, Dependency Config |
| Module 09 | π’ Ready | The Validation, Decorators Pattern |
| Module 10 | π’ Ready | Functional Power, Functools, Itertools |
Getting germinette running is easy!
- Python 3.10 or higher (Installed by default on 42 machines)
Open your terminal and run these commands:
# 1. Clone the repository
git clone https://github.com/ExceptedPrism3/germinette.git
cd germinette
# 2. Run the install script
./install.shThat's it! The script will install Germinette and automatically configure your PATH (so you can run the command from anywhere).
If Python is externally managed, ./install.sh detects it and automatically uses the same isolated install as --home (creates .germinenv, installs there, symlinks germinette to ~/.local/bin). You can still run ./install.sh --home directly if you prefer.
If you use uvβs Python, keep uv on your PATH: the script will create .germinenv with uv venv (stdlib venv / ensurepip often fails on those interpreters).
If installation fails, please open an issue on GitHub.
To update Germinette later, simply run this command from anywhere:
germinette -uGerminette now remembers where you installed it, so it will automatically pull the latest changes and reinstall itself.
Navigate to your exercise directory and run:
germinetteOr test a specific module/exercise:
germinette python_module_01
germinette -e "Exercise 2"To remove Germinette completely:
./uninstall.shThis will remove the package and clean up your configuration.
Navigate to your project folder (where your ex00, ex01 folders are) and run:
germinetteIt will automatically detect which module you are working on (e.g., python_module_00 or python_module_01 etc...) and run the tests.
If auto-detection is confused, or you want to be explicit:
germinette python_module_00or
germinette python_module_01Different 42 projects have different strict naming conventions. Germinette enforces the conventions specified in the subject PDF for each module.
For Module 00 and Module 01, the subject explicitly requires:
python_module_00/
βββ ex0/
β βββ ft_hello_garden.py
...
- Use
ex0,ex1, etc. (Notex00). - Always check your subject PDF! If a future module requires
ex00, Germinette will be updated to enforce that specific rule for that module.
Found a bug? The tester saying "KO" when it should be "OK"?
- Check the Subject: 42 subjects are tricky. Double-check the PDF requirements.
- Open an Issue: Please verify your folder structure key-by-key, then open an issue on this repository with:
- Your OS (Mac/Ubuntu)
- The module and exercise
- The error output
We welcome contributions! If you want to add support for missing modules, or fix a bug:
π Read the Contribution Guide for step-by-step instructions!
- Fork the repo.
- Create a branch for your feature (
git checkout -b feature/project_name). - Implement the tester following the guide.
- Submit a Pull Request!
Your project should look something like this for auto-detection to work best:
python_module_00/
βββ ex0/
β βββ ft_hello_garden.py
βββ ex1/
β βββ ft_plot_area.py
...
Regression check for the Module 07 tester (golden reference under tests/fixtures/python_module_07_golden/):
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python3 -m pip install -e ".[dev]"
python3 -m pytest tests/test_integration_module07.py -vIf you see No module named pytest after pip install: your shell may be using a different python than the venvβs (common with Conda base + venv). Fix one of these:
- Prefer
python3 -m pipandpython3 -m pytest(same interpreter aspython3in the venv), or - Run explicitly:
.venv/bin/python -m pytest tests/test_integration_module07.py -v, or conda deactivatethen activate only.venv.
Avoid pip install -r .[dev] β extras belong in quotes: pip install -e ".[dev]".
CI runs the same on push/PR (see .github/workflows/ci.yml).
This project is licensed under the MIT License - see the LICENSE file for details.
| Latest release (this tree) | v1.7.0 |
| Update installed Germinette | germinette -u |
| All changes by version | CHANGELOG.md |
If you installed months ago or from a fork, you may be on an old tester. Update first β many βbugsβ are already fixed in a newer release.
After each run, the CLI prints a Disclaimer panel, then a version line at the very end (or a yellow βupdate availableβ panel if GitHub is newer). If every exercise in that run passed with no recorded errors, a green βAll exercises passedβ panel appears above the disclaimer.