[PR #1746] [MERGED] Fix CLI tests to use subprocess and remove mocks #1496

Closed
opened 2026-03-01 14:50:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ArchiveBox/ArchiveBox/pull/1746
Author: @pirate
Created: 12/31/2025
Status: Merged
Merged: 12/31/2025
Merged by: @pirate

Base: devHead: claude/fix-cli-tests-macdO


📝 Commits (1)

  • b87bbbb Fix CLI tests to use subprocess and remove mocks

📊 Changes

6 files changed (+208 additions, -269 deletions)

View changed files

📝 archivebox/cli/tests_piping.py (+2 -30)
📝 archivebox/tests/conftest.py (+65 -98)
📝 archivebox/tests/test_cli_archiveresult.py (+38 -38)
📝 archivebox/tests/test_cli_crawl.py (+36 -36)
📝 archivebox/tests/test_cli_run.py (+27 -27)
📝 archivebox/tests/test_cli_snapshot.py (+40 -40)

📄 Description

Summary

Related issues

Changes these areas

  • Bugfixes
  • Feature behavior
  • Command line interface
  • Configuration options
  • Internal architecture
  • Snapshot data layout on disk

Summary by cubic

Converted CLI tests to run the real ArchiveBox CLI via subprocess with an isolated DATA_DIR, removing mock-based tests and the cli_env fixture. This ensures tests exercise real code paths and improves reliability.

  • Refactors
    • Added run_archivebox_cmd helper to invoke archivebox via subprocess.
    • Replaced cli_env with initialized_archive that runs archivebox init via subprocess.
    • Updated tests to pass data_dir instead of env; removed MagicMock/patch imports.
    • Dropped mock-based TestJSONLOutput; serialization is covered by integration tests.
    • Disabled slow extractors in test env for faster runs.

Written for commit b87bbbbecb. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ArchiveBox/ArchiveBox/pull/1746 **Author:** [@pirate](https://github.com/pirate) **Created:** 12/31/2025 **Status:** ✅ Merged **Merged:** 12/31/2025 **Merged by:** [@pirate](https://github.com/pirate) **Base:** `dev` ← **Head:** `claude/fix-cli-tests-macdO` --- ### 📝 Commits (1) - [`b87bbbb`](https://github.com/ArchiveBox/ArchiveBox/commit/b87bbbbecb71d5e43ee34922ed99b838350def79) Fix CLI tests to use subprocess and remove mocks ### 📊 Changes **6 files changed** (+208 additions, -269 deletions) <details> <summary>View changed files</summary> 📝 `archivebox/cli/tests_piping.py` (+2 -30) 📝 `archivebox/tests/conftest.py` (+65 -98) 📝 `archivebox/tests/test_cli_archiveresult.py` (+38 -38) 📝 `archivebox/tests/test_cli_crawl.py` (+36 -36) 📝 `archivebox/tests/test_cli_run.py` (+27 -27) 📝 `archivebox/tests/test_cli_snapshot.py` (+40 -40) </details> ### 📄 Description <!-- IMPORTANT: Do not submit PRs with only formatting / PEP8 / line length changes. --> # Summary <!--e.g. This PR fixes ABC or adds the ability to do XYZ...--> # Related issues <!-- e.g. #123 or Roadmap goal # https://github.com/pirate/ArchiveBox/wiki/Roadmap --> # Changes these areas - [ ] Bugfixes - [ ] Feature behavior - [ ] Command line interface - [ ] Configuration options - [ ] Internal architecture - [ ] Snapshot data layout on disk <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Converted CLI tests to run the real ArchiveBox CLI via subprocess with an isolated DATA_DIR, removing mock-based tests and the cli_env fixture. This ensures tests exercise real code paths and improves reliability. - **Refactors** - Added run_archivebox_cmd helper to invoke archivebox via subprocess. - Replaced cli_env with initialized_archive that runs archivebox init via subprocess. - Updated tests to pass data_dir instead of env; removed MagicMock/patch imports. - Dropped mock-based TestJSONLOutput; serialization is covered by integration tests. - Disabled slow extractors in test env for faster runs. <sup>Written for commit b87bbbbecb71d5e43ee34922ed99b838350def79. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 14:50:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#1496
No description provided.