Skip to content

Tests are failing when openpyxl is not installed. #568

Open
@harshpalan

Description

@harshpalan

When running pytest tests\ --local after the 0.3.7 release, the tests are failing since they are not able to get openpyxl and it escaping the try/except block added in the dataset (compmusic_carnatic_rhythm and compmusic_hindustani_rhythm)

ImportError while importing test module 'E:\MARL\myrepo\mirdata\tests\datasets\test_carnatic_rhythm.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
c:\users\harsh\appdata\local\programs\python\python37\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\datasets\test_carnatic_rhythm.py:4: in <module>
    from mirdata.datasets import compmusic_carnatic_rhythm
mirdata\datasets\compmusic_carnatic_rhythm.py:60: in <module>
    from openpyxl import load_workbook as get_xlxs
Hint: make sure your test modules/packages have valid Python names.
tests\datasets\test_hindustani_rhythm.py:4: in <module>
    from mirdata.datasets import compmusic_hindustani_rhythm
mirdata\datasets\compmusic_hindustani_rhythm.py:58: in <module>
    from openpyxl import load_workbook as get_xlxs
E   ModuleNotFoundError: No module named 'openpyxl'

I and @magdalenafuentes were thinking if we should add all dataset-dependent packages to tests in setup.py. @genisplaja and @nkundiushuti what do you guys think about this solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestschanges to tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions