urinieto / msaf

Music Structure Analysis Framework
MIT License
501 stars 79 forks source link

Use pytest instead of nose #132

Closed carlthome closed 1 year ago

carlthome commented 1 year ago
  1. Replace nose.tools.raises and nose.tools.assert_raises with pytest.raises
  2. Use direct function calls instead of yield based tests to resolve https://github.com/urinieto/msaf/issues/129 and to make tests run.
  3. Fix import warning about scipy.ndimage.filters -> scipy.ndimage
carlthome commented 1 year ago

There's probably a clever way of making sure each yielded test is treated as an independent unit test by:

  1. https://docs.pytest.org/en/7.2.x/how-to/fixtures.html
  2. https://docs.pytest.org/en/7.2.x/example/parametrize.html#paramexamples

but I figured that's a bit involved.

At least having every assert run sequentially is better than having them skipped entirely.

urinieto commented 1 year ago

This looks good, thanks! Where can I see the Actions live? According to this there are 5 tests that fail. Am I looking at the right run?

carlthome commented 1 year ago

This looks good, thanks! Where can I see the Actions live? According to this there are 5 tests that fail. Am I looking at the right run?

https://github.com/urinieto/msaf/pull/132/checks

I usually click next to the commit in the web view to find the related workflow run:

Screenshot 2023-06-14 at 13 21 34
urinieto commented 1 year ago

Gotcha, thanks. This is great, merging it!