[Other] tools/test_strata_mcp.py: unittest.main() sits before the last three test classes, so a direct run skips 7 tests

Open Beginner friendly
#4,906 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@XiaoBinGan is already working on this.

Since Nov 1, 2026.

  • #4907 by @XiaoBinGan — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Open tools/test_strata_mcp.py and find the if __name__ == "__main__": block with unittest.main() near line 937, which sits before the classes RemoveMissingFilesTest, DiskUsageTest and DraftLayerAndCancel. Move that guard to the end of the file so every class is defined before it runs. Done when python tools/test_strata_mcp.py reports 52 tests, matching python -m unittest tools.test_strata_mcp. The one failure from the Mac DeepSeek check belongs to #4904 and is outside this fix.

Written by the indexing model from the issue text.

Description

tools/test_strata_mcp.py ends its run early when it is executed directly: its if __name__ == "__main__": unittest.main() block sits at line 937 of 1112, before the last three test classes. unittest.main() collects the
classes defined at that point, so the classes appended after it never run.

Reproduce

$ python tools/test_strata_mcp.py
Ran 45 tests in 68.455s
FAILED (failures=1)                      # the Mac DeepSeek check, a separate issue (#4904)

$ python -m unittest tools.test_strata_mcp
Ran 52 tests in ...                      # the same 45 plus the 7 below

The 7 tests in RemoveMissingFilesTest, DiskUsageTest and DraftLayerAndCancel are skipped by the direct run,
silently, with no warning. They are in the file's own sections ("Deleting a model whose plan lists files that are
already gone…", "Storage showed IQ3_S as 0.0 GB…", draft-layer progress), so a person running the file the way the
other tools/test_*.py files are run does not see them pass or fail.

The classes came in later commits (917d2fc3, 31030b17) appended at the end of the file, after the guard that
was already in the middle.

Expected

Every test in the file runs in a direct run as well, like the other tools/test_strata_mcp.py classes.

Dominant language
C++
Stars
11.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Niko1221/Strata

All issues in Niko1221/Strata

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.