File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
report :
11
- runs-on : ubuntu-22.04
11
+ runs-on : ubuntu-latest
12
12
strategy :
13
13
matrix :
14
14
python-version : ["3.10"]
23
23
run : |
24
24
python -m pip install --upgrade pip wheel setuptools
25
25
python -m pip install ".[test]"
26
+ python -m pip install --upgrade numpy
27
+ python -m pip uninstall --yes scipy
26
28
pip list
27
29
28
30
- name : Measure test coverage
Original file line number Diff line number Diff line change @@ -49,22 +49,16 @@ def test_lazy_import_impact_on_sys_modules():
49
49
50
50
51
51
def test_lazy_import_nonbuiltins ():
52
- sp = lazy .load ("scipy" )
53
52
np = lazy .load ("numpy" )
53
+ sp = lazy .load ("scipy" )
54
+ if not isinstance (np , lazy .DelayedImportErrorModule ):
55
+ assert np .sin (np .pi ) == pytest .approx (0 , 1e-6 )
54
56
if isinstance (sp , lazy .DelayedImportErrorModule ):
55
57
try :
56
58
sp .pi
57
59
assert False
58
60
except ModuleNotFoundError :
59
61
pass
60
- elif isinstance (np , lazy .DelayedImportErrorModule ):
61
- try :
62
- np .sin (np .pi )
63
- assert False
64
- except ModuleNotFoundError :
65
- pass
66
- else :
67
- assert np .sin (sp .pi ) == pytest .approx (0 , 1e-6 )
68
62
69
63
70
64
def test_lazy_attach ():
You can’t perform that action at this time.
0 commit comments