Skip to content

Python unit tests fail after collection due to result/API contract mismatches #28

Description

@Rgeph

Summary

After bypassing collection errors with --continue-on-collection-errors, many unit tests still fail because test expectations no longer match the current Python API contracts.

Reproduction

cd python
python -m pip install --user -e . pytest
python -m pytest tests/unit -q --tb=short -ra --continue-on-collection-errors

Current result

19 failed, 694 passed, 5 errors

Main failure groups

Spectrum metrics key mismatch

Several calibration tests call:

analyze_spectrum(...)["sndr_db"]

but the current spectrum API returns metrics using sndr_dbc.

Examples:

  • tests/unit/calibration/test_verify_calibration_full.py
  • tests/unit/calibration/test_verify_calibration_full_multi_datasets.py
  • tests/unit/calibration/test_verify_calibration_lite.py

Polar/decomposition return shape mismatch

tests/unit/aout/test_verify_spec_plot_phase.py expects two return values from:

analyze_spectrum_polar(...)
analyze_decomposition_polar(...)

but the current functions return more values, causing:

ValueError: too many values to unpack (expected 2)

AOUT result field mismatch

tests/unit/aout/test_analyze_error_phase_plane.py expects fitted_sine, but the current result contains fitted_params and related fields instead.

Calibration/frequency edge case

tests/unit/calibration/test_verify_estimate_frequencies.py::test_freq_estimation_shuffled hits:

ZeroDivisionError: float division by zero

inside compute_spectrum when a degenerate/zero signal path reaches THD calculation.

Windows symlink privilege

One skill CLI test fails separately on Windows because editable installs use symlinks without checking privilege:

OSError: [WinError 1314] The client does not have a required privilege

That may deserve a platform-specific skip/fallback or its own fix.

Expected behavior

Unit tests should either:

  • be updated to match the current public API, or
  • the package should provide compatibility aliases/fields where those APIs are intended to remain supported.

Notes

This is separate from the test collection failures tracked in #27. Those collection errors prevent a normal test run from reaching these failures unless --continue-on-collection-errors is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions