Skip to content

Fix warnings and deprecation messages in test suite #154

@seonghobae

Description

@seonghobae

Description

Running the test suite on main currently yields a warning:
RuntimeWarning: 'bandscope_analysis.cli' found in sys.modules after import of package 'bandscope_analysis', but prior to execution of 'bandscope_analysis.cli'; this may result in unpredictable behaviour

Other deprecation warnings (librosa, audioread) were addressed in separate feature branches (PR #149). This issue tracks fixing the remaining root causes of runtime warnings during pytest execution.

Root Cause Analysis

  • The RuntimeWarning is caused by testing runpy.run_module against a module that is already imported at the top of the test file (test_cli.py). Python's runpy issues a warning when doing this because running an already-imported module as __main__ can cause side effects.

Action Plan

  • Refactor the test or the import logic in test_cli.py to eliminate the RuntimeWarning.
  • Ensure all tests run with 0 warnings on the default branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions