CPJKU / madmom

Python audio and music signal processing library
https://madmom.readthedocs.io
Other
1.35k stars 206 forks source link

Fix broken tests by including required assets in package_data #532

Closed carlthome closed 12 months ago

carlthome commented 12 months ago

Working on packaging madmom in nixpkgs (WIP here) and noticed that specific tests failed when testing the installed (non-editable) package by:

MCVE

git clone https://github.com/CPJKU/madmom.git
cd madmom

git submodule init
git submodule update

python -m venv .venv
source .venv/bin/activate

pip install .
pip install pytest

rm -r madmom

pytest

Output

====================================================== short test summary info ======================================================
FAILED tests/test_bin.py::TestTCNBeatTrackerProgram::test_binary - IndexError: list index out of range
FAILED tests/test_bin.py::TestTCNBeatTrackerProgram::test_run - IndexError: list index out of range
FAILED tests/test_bin.py::TestTCNTempoDetectorProgram::test_binary - IndexError: list index out of range
FAILED tests/test_bin.py::TestTCNTempoDetectorProgram::test_run - IndexError: list index out of range
FAILED tests/test_features_beats.py::TestTCNBeatProcessorClass::test_process_tcn - IndexError: list index out of range
====================================== 5 failed, 806 passed, 188 warnings in 60.53s (0:01:00) =======================================

Turns out these tests depend on static assets (2019 models) that are currently not included in package_data. This PR fixes that such that the installed package passes its tests.

carlthome commented 12 months ago

Already fixed in https://github.com/CPJKU/madmom/pull/531 - closing!