ESMValGroup / ESMValCore

ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.
https://www.esmvaltool.org
Apache License 2.0
42 stars 38 forks source link

Regrid with esmpy tests failing on CI due to mock=4 #453

Closed valeriupredoi closed 4 years ago

valeriupredoi commented 4 years ago
    def __new__(cls, *args, **kw):
        # every instance has its own class
        # so we can create magic methods on the
        # class without stomping on other mocks
        bases = (cls,)
        if not issubclass(cls, AsyncMockMixin):
            # Check if spec is an async object or function
            bound_args = _MOCK_SIG.bind_partial(cls, *args, **kw).arguments
            spec_arg = bound_args.get('spec_set', bound_args.get('spec'))
>           if spec_arg and _is_async_obj(spec_arg):
E           ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

.eggs/mock-4.0.0b1-py3.7.egg/mock/mock.py:411: ValueError

Honestly I gots no clues where the CI machine picks up mock=4.0.0b1 and not 3.0.5 that's in my env and in all the conda-forge and pypi repos. Will investigate more - any clues @bouweandela ?

zklaus commented 4 years ago

@valeriupredoi can I have the full log?

valeriupredoi commented 4 years ago

@zklaus e.g. here mate https://circleci.com/gh/ESMValGroup/ESMValCore/6951?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

bouweandela commented 4 years ago

We no longer need the mock library, we needed it for Python 2 and we no longer support that. In Python 3 it's available in the standard library as unittest.mock. I created #452 to fix this issue.

valeriupredoi commented 4 years ago

and I closed #454 cheers Bouwe!

valeriupredoi commented 4 years ago

Solved by #452