Skip to content

Conversation

@jarrodmillman
Copy link
Member

@jarrodmillman jarrodmillman commented Aug 27, 2022

Running

python -m pytest --cov=lazy_loader

works as expected; but running

python -m pytest --cov=lazy_loader --doctest-modules

yields

____________________ test_attach_same_module_and_attr_name _____________________

    def test_attach_same_module_and_attr_name():
        from lazy_loader.tests import fake_pkg
    
        # Grab attribute twice, to ensure that importing it does not
        # override function by module
>       assert isinstance(fake_pkg.some_func, types.FunctionType)
E       AssertionError: assert False
E        +  where False = isinstance(<module 'lazy_loader.tests.fake_pkg.some_func' from '/home/runner/work/lazy_loader/lazy_loader/lazy_loader/tests/fake_pkg/some_func.py'>, <class 'function'>)
E        +    where <module 'lazy_loader.tests.fake_pkg.some_func' from '/home/runner/work/lazy_loader/lazy_loader/lazy_loader/tests/fake_pkg/some_func.py'> = <module 'lazy_loader.tests.fake_pkg' from '/home/runner/work/lazy_loader/lazy_loader/lazy_loader/tests/fake_pkg/__init__.py'>.some_func
E        +    and   <class 'function'> = types.FunctionType

lazy_loader/tests/test_lazy_loader.py:104: AssertionError

@jarrodmillman jarrodmillman marked this pull request as draft August 27, 2022 15:15
@jarrodmillman jarrodmillman requested review from stefanv and tupui August 27, 2022 15:18
@jarrodmillman
Copy link
Member Author

jarrodmillman commented Sep 16, 2022

See scientific-python/specs#151 and #29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant