JamesOwers / midi_degradation_toolkit

A toolkit for generating datasets of midi files which have been degraded to be 'un-musical'.
MIT License
38 stars 5 forks source link

improve testing code coverage #148

Open JamesOwers opened 4 years ago

JamesOwers commented 4 years ago

We're at 60%. To regenerate the report with lines that need covering, run pytest -vv --cov --cov-report term-missing

Also you can get nice reports with:

pytest --cov-report html
open htmlcov/index.html
========================================================================== test session starts ===========================================================================
platform darwin -- Python 3.8.5, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /Users/jfowers/git/midi_degradation_toolkit, configfile: setup.cfg, testpaths: mdtk/tests
plugins: cov-2.10.1
collected 29 items                                                                                                                                                       

mdtk/tests/test_degradations.py ............                                                                                                                       [ 41%]
mdtk/tests/test_df_utils.py ...                                                                                                                                    [ 51%]
mdtk/tests/test_downloaders.py ......                                                                                                                              [ 72%]
mdtk/tests/test_fileio.py ........                                                                                                                                 [100%]

---------- coverage: platform darwin, python 3.8.5-final-0 -----------
Name                              Stmts   Miss  Cover
-----------------------------------------------------
mdtk/__init__.py                      6      0   100%
mdtk/degradations.py                372     23    94%
mdtk/degrader.py                     46     46     0%
mdtk/df_utils.py                     44      3    93%
mdtk/downloaders.py                 124      4    97%
mdtk/eval.py                         64     64     0%
mdtk/fileio.py                       71      5    93%
mdtk/filesystem_utils.py             47     19    60%
mdtk/formatters.py                  177    177     0%
mdtk/inspection.py                   89     89     0%
mdtk/pytorch_datasets.py            125    125     0%
mdtk/pytorch_models.py               91     91     0%
mdtk/pytorch_trainers.py            336    336     0%
mdtk/tests/__init__.py                0      0   100%
mdtk/tests/test_degradations.py     438      8    98%
mdtk/tests/test_df_utils.py          45      0   100%
mdtk/tests/test_downloaders.py       42      0   100%
mdtk/tests/test_fileio.py           218      0   100%
-----------------------------------------------------
TOTAL                              2335    990    58%