Instruction file imported from Ofido/AIUnitTest (
.github/instructions/general.instructions.md). Copyright stays with the author.
AIUnitTest – Copilot & Developer Instructions
Running Tests
-
Activate the virtual environment:
source env/bin/activate -
Install dependencies (if needed):
make install-dev -
Run tests:
-
All unit tests (default):
make test -
Only unit tests:
make test-unit -
Unit tests with coverage report:
make test-unit-cov- Coverage HTML report:
htmlcov/index.html
- Coverage HTML report:
-
Integration tests:
make test-integration -
All tests (including slow):
make test-all -
Fast tests (excluding slow):
make test-fast -
Watch mode (auto re-run on file change):
make test-watch -
Using global pytest (not recommended):
make test-simple
-
Note: All test commands require the virtual environment to be active and dependencies installed.
Project Structure
- Source code:
src/ai_unit_test/ - Tests:
tests/ - Configs:
pyproject.toml,requirements.txt - Docs:
README.md,docs/
Coding Conventions
- Use descriptive names for functions and variables.
- Cover normal and edge cases in tests.
- Follow mypy standards (see: mypy-lang.org/) and configured
flake8/banditrules. - Never skip pre-commit hooks.
- Always run commands inside the project environment (
source env/bin/activate). - Follow clean code best practices.
Quick Onboarding
-
Clone the repo and enter the project folder.
-
Create and activate the virtual environment:
python3 -m venv env source env/bin/activate -
Install all dependencies:
make install-dev -
Run tests and check code quality before committing.
If you have questions, check the documentation or ask your team!