Skip to content

Fix failing tests after CMIP6 climate patterns merge #3670

Closed
@ehogan

Description

@ehogan

I noticed that the tests are failing since the CMIP6 climate patterns PR (#2785) was merged:

 _ ERROR collecting esmvaltool/diag_scripts/climate_patterns/climate_patterns.py _
ImportError while importing test module '/home/runner/work/ESMValTool/ESMValTool/esmvaltool/diag_scripts/climate_patterns/climate_patterns.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../miniconda3/envs/esmvaltool-fromlock/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
esmvaltool/diag_scripts/climate_patterns/climate_patterns.py:41: in <module>
    from plotting import (
E   ImportError: cannot import name 'plot_timeseries' from 'plotting' (/home/runner/work/ESMValTool/ESMValTool/esmvaltool/diag_scripts/arctic_ocean/plotting.py)
____ ERROR collecting esmvaltool/diag_scripts/climate_patterns/plotting.py _____
import file mismatch:
imported module 'plotting' has this __file__ attribute:
  /home/runner/work/ESMValTool/ESMValTool/esmvaltool/diag_scripts/arctic_ocean/plotting.py
which is not the same as the test file we want to collect:
  /home/runner/work/ESMValTool/ESMValTool/esmvaltool/diag_scripts/climate_patterns/plotting.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

All the checks were passing on the PR. Is it possible to update the PR checks to catch issues like this?

I will open a PR now with a fix 😊

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions