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

Open
opened 2026-11-04 01:57:56 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @XiaoBinGan on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4906

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.

Originally created by @XiaoBinGan on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4906 `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 ```text $ 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.
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
Niko1221/Strata#2253
No description provided.