Skip to content

Commit 942f8d6

Browse files
committed
Fix
1 parent 0929bec commit 942f8d6

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

.github/workflows/coverage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
python -m pip install ".[test]"
2626
pip list
2727
28-
- name: Test NetworkX
28+
- name: Measure test coverage
2929
run: |
30-
python -m pytest --cov=lazy_loader --doctest-modules --durations=20
30+
python -m pytest --cov=lazy_loader --durations=10
31+
# Tests fail if using `--doctest-modules`. I.e.,
32+
# python -m pytest --cov=lazy_loader --doctest-modules --durations=20
3133
codecov

lazy_loader/tests/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/test_lazy_loader.py renamed to lazy_loader/tests/test_lazy_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ def test_lazy_attach():
9797

9898

9999
def test_attach_same_module_and_attr_name():
100-
import fake_pkg
100+
from lazy_loader.tests import fake_pkg
101101

102102
# Grab attribute twice, to ensure that importing it does not
103103
# override function by module
104104
assert isinstance(fake_pkg.some_func, types.FunctionType)
105105
assert isinstance(fake_pkg.some_func, types.FunctionType)
106106

107107
# Ensure imports from submodule still work
108-
from fake_pkg.some_func import some_func
108+
from lazy_loader.tests.fake_pkg.some_func import some_func
109109

110110
assert isinstance(some_func, types.FunctionType)
111111

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

127127

128128
def test_stub_loading_parity():
129-
import fake_pkg
129+
from lazy_loader.tests import fake_pkg
130130

131131
from_stub = lazy.attach_stub(fake_pkg.__name__, fake_pkg.__file__)
132132
stub_getter, stub_dir, stub_all = from_stub

0 commit comments

Comments
 (0)