Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Aug 27, 2022
1 parent 0929bec commit 942f8d6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
python -m pip install ".[test]"
pip list
- name: Test NetworkX
- name: Measure test coverage
run: |
python -m pytest --cov=lazy_loader --doctest-modules --durations=20
python -m pytest --cov=lazy_loader --durations=10
# Tests fail if using `--doctest-modules`. I.e.,
# python -m pytest --cov=lazy_loader --doctest-modules --durations=20
codecov
Empty file added lazy_loader/tests/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ def test_lazy_attach():


def test_attach_same_module_and_attr_name():
import fake_pkg
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)
assert isinstance(fake_pkg.some_func, types.FunctionType)

# Ensure imports from submodule still work
from fake_pkg.some_func import some_func
from lazy_loader.tests.fake_pkg.some_func import some_func

assert isinstance(some_func, types.FunctionType)

Expand All @@ -126,7 +126,7 @@ def test_stub_loading(tmp_path):


def test_stub_loading_parity():
import fake_pkg
from lazy_loader.tests import fake_pkg

from_stub = lazy.attach_stub(fake_pkg.__name__, fake_pkg.__file__)
stub_getter, stub_dir, stub_all = from_stub
Expand Down

0 comments on commit 942f8d6

Please # to comment.