WARNING: Please note that this project is in early development and may not be fully functional, if you notice any issues with the tests (e.g. false positives, false negatives or any other problems), please report them by opening an issue on GitHub with a detailed description. Thank you for your understanding and support !
A test automation framework for the 42 Python modules.
pythonette runs flake8, executes each exercise against a battery of test cases, and reports the result with rich panels. It is designed to install and run on 42 workstations without any admin privileges.
bash -c "$(curl -fsSL https://raw.githubusercontent.com/roxxorarc/pythonette-42/main/install.sh)"git clone https://github.com/roxxorarc/pythonette-42.git
cd pythonette-42
./install.shIf ~/.local/bin is not already on your PATH, the installer adds it
to ~/.zshrc automatically. Apply it to your current session with:
source ~/.zshrcRequirements: Python 3.10 or newer and git. No admin privileges required.
From inside any directory containing your exercise files:
pythonette # auto-detect, run every detected exercise
pythonette -m 00 # only module 00
pythonette -e ex02 # only the ex02 exercise (any module)
pythonette --diff # show colored diffs on failure
pythonette --explain # print a hint on each failure
pythonette -u # git pull + reinstall
pythonette -V # versionDetection is filename-based. A file like ft_plot_area.py is
identified as module 00 / ex02 regardless of where it sits in your
tree, so any layout works:
my_42_python/
βββ python_module_00/ex2/ft_plot_area.py
βββ python_module_01/ex0/ft_garden_intro.py
| # | Title | Exercises | Coverage highlights |
|---|---|---|---|
| 00 | Growing Code β Python fundamentals through garden data | 8 | Basic syntax, conditionals, loops, recursion, type hints |
| 01 | Code Cultivation β object-oriented garden systems | 7 | Classes, inheritance, dunder methods, encapsulation |
| 02 | Garden Guardian β data engineering for smart agriculture | 5 | Exceptions, custom error hierarchies, try/except/finally |
| 03 | Data Quest β mastering Python collections | 7 | Lists, tuples, sets, dicts, comprehensions, argv |
| 04 | Data Archivist β Digital Preservation in the Cyber Archives | 4 | File I/O, with context managers, argv pipelines |
| 05 | Code Nexus β Polymorphic Data Streams in the Digital Matrix | 3 | Abstract base classes, polymorphism, typing.Protocol |
| 06 | The Codex β Mastering Python's Import Mysteries | 4 | Absolute/relative imports, package layout, circular imports |
| 07 | DataDeck β Abstract Card Architecture | 3 | ABCs, factories, capability mixins, strategy pattern |
| 08 | The Matrix β Welcome to the Real World of Data Engineering | 3 | Virtual envs, requirements.txt / pyproject.toml, dotenv |
| 09 | Cosmic Data β Discover Pydantic Models & Validation | 3 | Pydantic 2 BaseModel, Field constraints, @model_validator |
| 10 | FuncMage Chronicles β Master the Ancient Arts of Functional Programming | 5 | Lambdas, higher-order functions, closures, functools, decorators |
For each detected exercise:
- Style β
flake8andmypy(strict) run on every file in the exercise. Failures are listed inline but do not stop the rest of the checks. The mypy cache lives under~/.cache/pythonette/mypy/so warm runs are an order of magnitude faster than cold ones. - Static checks β AST-only assertions (
StructureCheck,AuthorizedCheck,ImportCheck, β¦) verify structure without executing the student code. - Runtime checks β the student files are copied into a temp dir,
then a generated harness imports/calls/runs them in a subprocess.
Used for
SignatureCheck,AssertCheck,RunCheck,ScriptCheck, etc. Default timeout: 5 seconds (treated as a possible infinite loop). - Output matching β stdout is matched against
expected_stdout(exact) orexpected_contains/stdout_contains(substring list). Non-zero exit codes and tracebacks surface as the failure reason.
- CONTRIBUTING.md β project architecture, the full check toolbox, and a worked example of adding an exercise or a new module.