test: stop shipping the git_repo fixture in the tests bundle - #1389
Merged
Conversation
The tests bundle shipped a self-contained, self-testing trio to every consumer repo — the git_repo fixture (in conftest.py), its only consumer test_git_repo_fixture.py, and test_utils.py (whose GIT export only the fixture used). None of it is usable by consumers: it exists purely to test itself, so it lands as dead code in every downstream project (e.g. jquantstats had to strip it after deleting the fixture test). Relocate the git_repo fixture and its self-test into rhiza's own tests/ suite so rhiza keeps exercising the fixture, and remove them from the bundle: - bundles/.../conftest.py: keep only the root + logger fixtures - bundles/.../test_utils.py: deleted (helpers already exist as tests/util.py for rhiza's own suite; unused inside the bundle) - bundles/.../test_git_repo_fixture.py -> tests/test_git_repo_fixture.py - tests/conftest.py: gains the git_repo fixture + mock uv/make scripts - drop the now-dangling .rhiza/tests symlinks and update the bundle README Consumers now receive a lean bundle (pyproject/readme/docstring tests plus root/logger fixtures). Verified: relocated fixture test + bundle suite pass (45 passed, 2 skipped); full tests/ tree collects cleanly (1341 tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR trims the downstream-shipped tests bundle by removing the self-testing git_repo fixture and its utilities from the bundle, while keeping rhiza’s own test coverage by relocating the fixture/test into the mother-repo tests/ suite.
Changes:
- Removed
git_repo+ related helpers frombundles/tests/.rhiza/tests, keeping onlyroot/loggerfixtures for consumers. - Moved the
git_repofixture test totests/test_git_repo_fixture.pyand added agit_repofixture implementation totests/conftest.py. - Updated the bundled
.rhiza/testsREADME to reflect the slimmer bundle contents.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_git_repo_fixture.py | Updates module docstring to clarify the fixture is rhiza-internal and not shipped in the bundle. |
| tests/conftest.py | Adds an internal git_repo fixture and mock uv/make scripts to support rhiza’s own integration-style tests. |
| bundles/tests/.rhiza/tests/test_utils.py | Deletes bundle-only helper module that was only used by the removed fixture/test. |
| bundles/tests/.rhiza/tests/README.md | Removes references to the removed fixture/test_utils from bundle documentation. |
| bundles/tests/.rhiza/tests/conftest.py | Removes git_repo fixture and related machinery; retains root and logger. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+138
to
+142
| @pytest.fixture | ||
| def git_repo(root, tmp_path, monkeypatch): | ||
| """Sets up a remote bare repo and a local clone with necessary files.""" | ||
| remote_dir = tmp_path / "remote.git" | ||
| local_dir = tmp_path / "local" |
Comment on lines
+19
to
+28
| # Get absolute path for git to avoid S607 warnings | ||
| GIT = shutil.which("git") or "/usr/bin/git" | ||
|
|
||
| MOCK_MAKE_SCRIPT = """#!/usr/bin/env python3 | ||
| import sys | ||
|
|
||
| if len(sys.argv) > 1 and sys.argv[1] == "help": | ||
| print("Mock Makefile Help") | ||
| print("target: ## Description") | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
testsbundle shipped a self-contained, self-testing trio to every consumer repo:git_repofixture (inbundles/tests/.rhiza/tests/conftest.py),test_git_repo_fixture.py,test_utils.py, whoseGITexport only that fixture used (itsrun_make/strip_ansi/setup_rhiza_git_repohelpers were never used inside the bundle).None of it is usable by consumers — it exists purely to test itself, so it lands as dead code in every downstream project. This surfaced in
jquantstats, which had to strip the fixture,test_utils.py, and the orphanedtest_git_repo_fixture.pyafter deleting the fixture test, diverging from the template.Change
Relocate the git-repo machinery into rhiza's own
tests/suite (so rhiza keeps exercising the fixture) and remove it from the bundle that flows down to consumers:bundles/tests/.rhiza/tests/conftest.pyroot+loggerfixturesbundles/tests/.rhiza/tests/test_utils.pytests/util.py; unused in the bundle)bundles/tests/.rhiza/tests/test_git_repo_fixture.py→tests/test_git_repo_fixture.pytests/conftest.pygit_repofixture + mockuv/makescripts.rhiza/tests/{test_utils,test_git_repo_fixture}.pybundles/tests/.rhiza/tests/README.mdConsumers now receive a lean bundle:
pyproject/readme/docstringtests plus theroot/loggerfixtures.Verification
uv run --group test pytest tests/test_git_repo_fixture.py .rhiza/tests)tests/tree collects cleanly: 1341 tests, no import errors🤖 Generated with Claude Code