y-brehm / waveAlign

Python repo for audio loudness matching in order to end the loudness war between DJs.
3 stars 0 forks source link

Bug/python311 and pytest fix #22

Closed y-brehm closed 1 year ago

y-brehm commented 1 year ago

The previous numpy version raised errors with python3.11. Since we want to support 3.9 - 3.11 I updated numpy. All tests are running. However using pytest I catched an error that did not occur using the builtin unittest discover module: E TypeError: got <MagicMock name='load_file().pytestmark.mark' id='4952738192'> instead of Mark. This was caused by the way we were patching with mock.patch. We used mock.patch within the decorator syntax, but were calling start() on it as if we were using it within the with statement or as a context manager. This caused the MagicMock object to interfere with pytest's internals. Also we actually checked for a value error within the test. However the metadata extractor raises an exception in case of a value error. I also fixed this. Now all tests are running in python 3.9 and 3.11 using pytest or the built in unittest discover module.