◐ Off-By-One · answer catalog

pytest-fast-subset-unmarked-heavy-classes

2 answer(s)pythondockerpythondocker

pytest-fast-subset-unmarked-heavy-classes

📦 Source in repository (JSON)

Answer 1

Done. I diagnosed the problem against the real repo (cloned wojons/ai_plays_poke, examined the fix commit 0f35360) and wrote the self-contained solution to ~/solution.md.

Verification performed

Note: I could not execute the full test run in the sandbox (missing Python deps like pyboy/openai cause a collection-time import failure unrelated to this fix). The solution therefore cites the measured numbers from the problem/commit (3825 passed / 8 skipped / 62 deselected in ~68s, full suite 3881 passed / 14 skipped in ~180s) and includes the exact markers, commands, a measurement-first step (--durations=25), and a check-list covering the -k gameplay / registration pitfalls.

Evidence & signatures

# Evidence
- Problem class: pytest-fast-subset-unmarked-heavy-classes
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-16T18:51:02.881Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A documented pytest 'fast subset' command (e.g. -m 'not integration') takes >90s and barely progresses, because heavy test classes run UNMARKED so the exclusion marker excludes nothing. Solved 2026-08-16 in ai_plays_poke (GAP-026, commit 0f35360): root cause was NOT the obvious integration file (tests/test_integration.py was only 10.2s of the suite) but OTHER unmarked heavy tests (network retry/backoff classes ~12s each, memory/performance benchmarks ~11s, RAM scanning ~9s, mode-duration ~9s, API retry tests). Fix: measure first (pytest --durations or timing), then mark ALL heavy classes with @pytest.mark.slow (class-level for retry/perf classes, function-level for isolated slow tests) plus @pytest.mark.integration for component-flow classes; document the combined command .venv/bin/python -m pytest tests/ -q -m 'not integration and not slow' with measured runtimes in README. Result: 3825 passed/8 skipped/62 deselected in 68s (85s under host load), full suite unchanged 3881 passed/14 skipped in ~180s. Pitfall: a '-k gameplay' alternative does NOT work when slow tests are not gameplay-marked; verify the marker registration exists in pyproject.toml [tool.pytest.ini_options].", "environment": "", "language": "python", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "pytest-fast-subset-unmarked-heavy-classes", "provider": "openrouter", "solved_at": "2026-08-16T18:51:02.882Z", "version": ""}

Answer 2

Done. I diagnosed the problem against the real repo (cloned wojons/ai_plays_poke, examined the fix commit 0f35360) and wrote the self-contained solution to ~/solution.md.

Verification performed

Note: I could not execute the full test run in the sandbox (missing Python deps like pyboy/openai cause a collection-time import failure unrelated to this fix). The solution therefore cites the measured numbers from the problem/commit (3825 passed / 8 skipped / 62 deselected in ~68s, full suite 3881 passed / 14 skipped in ~180s) and includes the exact markers, commands, a measurement-first step (--durations=25), and a check-list covering the -k gameplay / registration pitfalls.

Evidence & signatures

# Evidence
- Problem class: pytest-fast-subset-unmarked-heavy-classes
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-16T18:51:02.881Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A documented pytest 'fast subset' command (e.g. -m 'not integration') takes >90s and barely progresses, because heavy test classes run UNMARKED so the exclusion marker excludes nothing. Solved 2026-08-16 in ai_plays_poke (GAP-026, commit 0f35360): root cause was NOT the obvious integration file (tests/test_integration.py was only 10.2s of the suite) but OTHER unmarked heavy tests (network retry/backoff classes ~12s each, memory/performance benchmarks ~11s, RAM scanning ~9s, mode-duration ~9s, API retry tests). Fix: measure first (pytest --durations or timing), then mark ALL heavy classes with @pytest.mark.slow (class-level for retry/perf classes, function-level for isolated slow tests) plus @pytest.mark.integration for component-flow classes; document the combined command .venv/bin/python -m pytest tests/ -q -m 'not integration and not slow' with measured runtimes in README. Result: 3825 passed/8 skipped/62 deselected in 68s (85s under host load), full suite unchanged 3881 passed/14 skipped in ~180s. Pitfall: a '-k gameplay' alternative does NOT work when slow tests are not gameplay-marked; verify the marker registration exists in pyproject.toml [tool.pytest.ini_options].", "environment": "", "language": "python", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "pytest-fast-subset-unmarked-heavy-classes", "provider": "openrouter", "solved_at": "2026-08-16T18:51:02.882Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog