← Back to issue list

tests: use tmp_path instead of mock_path

View original Github issue

Metadata

Project
rockcraft
Number
#118
Type
pull request
State
merged
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

Merged a unit test fix replacing mock_path with tmp_path to resolve fixture scope issues. Approved by one reviewer, passed CI, and modified 1 file (+3/-3 lines).

Suggested action:

No scores available.

Issue body

- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- Tiny change to a unit test. The test fixture `providers/conftest.py::mock_path` is leaving rockcraft, so I removed the only reference to it inside rockcraft's test suite.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged a unit test fix replacing mock_path with tmp_path to resolve fixture scope issues. Approved by one reviewer, passed CI, and modified 1 file (+3/-3 lines).
qwen3.6-35b-a3b-mtp-q6 Merged a test update replacing the mock_path fixture with tmp_path in unit tests, as mock_path was being removed from the codebase.
qwen3.6-35b-a3b-mtp-q6 Merged a test update replacing the mock_path fixture with tmp_path in the unit test suite, as the original fixture was being removed from the project.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#5375 test: fix command tests snapcraft merged Merged after updating test fixtures to resolve failing command unit tests. Approved by two reviewers, passed CI checks, and modified two files with 17 additions and 9 deletions.
74%
#51 cleanup: don't write test files in cwd rockcraft merged Merged a cleanup fix that isolates test data using tmp_path instead of writing to the current working directory. This keeps make test-units output clean. Approved by one reviewer and changed one file.
73%
#3024 tests: remove usage of FakeApt fixtures in lifecycle snapcraft merged Merged changes replacing FakeApt fixtures in lifecycle tests with targeted mock.patch calls and related cleanup. Approved by one reviewer and passed CI checks.
73%
#3910 unit tests: minor improvement to fixture usage snapcraft merged Merged into main after passing CI and review. The change refactors unit test fixture usage, modifying 8 lines across 2 files with zero impact on code coverage.
72%
#439 tests: protect fixture against chdir mocks craft-parts merged Merged updates to the new_dir test fixture to always call the original os.chdir. This prevents unexpected behavior when tests mock the function. Approved by one reviewer and modified three files.
72%
#575 test: fix mock chroot fixture craft-parts merged Merged a one-line fix for the mock chroot test fixture to ensure Python 3.11 compatibility, aligning with upstream CPython changes. Approved by two reviewers and passed CI checks.
71%
#1027 tests: fix broken unit test in master snapcraft merged Merged a one-line fix resolving a broken unit test in master. Approved by one reviewer with no unresolved comments. Changes passed CI and maintained 96.37% code coverage. Integrated directly into the main branch.
70%
#1928 tests: remove duplicate tests snapcraft merged Merged changes that remove duplicate tests and clarify test base class names to prevent future duplication. Approved by two reviewers, passed CI, and reduced unit test execution time.
70%