unzhakov
|
76d183b913
|
test: Phase 5 — advanced improvements
1. pytest-timeout (30s, thread-based) added to pyproject.toml
- Prevents hangs in CI
- timeout_method='thread' for clean cancellation
2. hypothesis added for property-based edge case discovery
- tests/common/test_hypothesis_tests.py: 5 tests
- Fermi: random Z, A, W — checks stability, monotonicity
- Phase space: random W0, W — checks threshold/endpoint properties
- Hypothesis already found real bugs:
* Fermi monotonicity fails for Z < 10 (expected — finite-size dominates)
* Phase space negative when W > W0 (test constrains W < W0)
3. pytest.mark.requires_ensdf marker added to TestPaceENSDFIntegration
- Replaces bare @pytest.mark.skipif with documented marker
- Allows running only ENSDF tests: pytest -m requires_ensdf
4. Updated test-migration-todo.md: Phase 5 complete
Final state: 256 tests passing (250 regular + 6 hypothesis + 6 skipped ENSDF)
|
2026-05-15 16:48:46 +03:00 |
|
unzhakov
|
c78d0655a0
|
test: complete migration to structured test suite
Phase 1: Removed 6 duplicate old test files (fermi, finite_size, screening,
exchange, radiative, phase_space) — their tests are now in physics/ and quality/
using shared helpers from common/.
Phase 2: Migrated remaining 7 old test files:
- test_spectrum.py → integration/test_spectrum_pipeline.py (integration tests)
- test_fitter.py → physics/test_fitter.py (fit quality tests)
- test_cw_extractor.py → physics/test_cw_extractor.py (extraction accuracy)
- test_multi_branch.py → physics/test_multi_branch.py (branching physics)
- test_detector_response.py → physics/ + quality/ (split into physics + API)
- test_nuclear_data.py → quality/test_nuclear_data.py (parsing/API)
- test_logging_utils.py → quality/test_logging_utils.py (API tests)
Removed 12 old flat files, created 4 new files.
Total: 251 tests passing (6 skipped), down from 230 → 251 (net +21
from better coverage, not duplicates).
Test structure:
- tests/common/ — shared property/API helpers (eliminates ~18 duplicates)
- tests/physics/ — 10 files, unique physics behavior tests
- tests/quality/ — 8 files, API contract + parsing tests
- tests/integration/ — 1 file, end-to-end pipeline tests
|
2026-05-15 15:52:50 +03:00 |
|