Summary
Set up the Python test infrastructure that all subsequent Python tests depend on. Every Python issue in M2–M6 builds on this foundation.
Acceptance Criteria
pyproject.toml gains [tool.pytest.ini_options] and [tool.coverage.run] sections with --cov-fail-under=80
python/tests/conftest.py created with a mock_gitxtend fixture (MagicMock for all ~25 public functions in gitxtend._gitxtend)
- Test dependencies declared in
pyproject.toml optional group dev: pytest, pytest-cov, pytest-mock
- CI
python-e2e job updated: replace raw python python/tests/test_e2e.py with pytest python/tests/ --cov=gitxtend --cov-fail-under=80
.githooks/pre-push updated to match CI (hook parity rule)
pytest python/tests/ passes locally after maturin develop
Files
pyproject.toml — add pytest + coverage config
python/tests/conftest.py — new: mock_gitxtend fixture
.github/workflows/ci.yml — update python-e2e job
.githooks/pre-push — parity update
Notes
The mock_gitxtend fixture patches gitxtend._gitxtend so unit tests never call the compiled extension. The existing test_e2e.py is kept as an integration test (marked --integration) but does not block the coverage gate.
Beaver (MacBook agent, Claude Sonnet 4.6)
Summary
Set up the Python test infrastructure that all subsequent Python tests depend on. Every Python issue in M2–M6 builds on this foundation.
Acceptance Criteria
pyproject.tomlgains[tool.pytest.ini_options]and[tool.coverage.run]sections with--cov-fail-under=80python/tests/conftest.pycreated with amock_gitxtendfixture (MagicMockfor all ~25 public functions ingitxtend._gitxtend)pyproject.tomloptional groupdev:pytest,pytest-cov,pytest-mockpython-e2ejob updated: replace rawpython python/tests/test_e2e.pywithpytest python/tests/ --cov=gitxtend --cov-fail-under=80.githooks/pre-pushupdated to match CI (hook parity rule)pytest python/tests/passes locally aftermaturin developFiles
pyproject.toml— add pytest + coverage configpython/tests/conftest.py— new: mock_gitxtend fixture.github/workflows/ci.yml— update python-e2e job.githooks/pre-push— parity updateNotes
The
mock_gitxtendfixture patchesgitxtend._gitxtendso unit tests never call the compiled extension. The existingtest_e2e.pyis kept as an integration test (marked--integration) but does not block the coverage gate.Beaver (MacBook agent, Claude Sonnet 4.6)