File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
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 scipy
27
+ python -m pip uninstall --yes pandas
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,29 @@ 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" )
54
- if isinstance (sp , lazy .DelayedImportErrorModule ):
53
+ sp = lazy .load ("scipy" )
54
+ pd = lazy .load ("pandas" )
55
+ if isinstance (np , lazy .DelayedImportErrorModule ):
55
56
try :
56
- sp . pi
57
+ np . sin ( np . pi )
57
58
assert False
58
59
except ModuleNotFoundError :
59
60
pass
60
- elif isinstance (np , lazy .DelayedImportErrorModule ):
61
+ elif isinstance (sp , lazy .DelayedImportErrorModule ):
61
62
try :
62
- np . sin ( np . pi )
63
+ sp . pi
63
64
assert False
64
65
except ModuleNotFoundError :
65
66
pass
66
67
else :
67
68
assert np .sin (sp .pi ) == pytest .approx (0 , 1e-6 )
69
+ if isinstance (pd , lazy .DelayedImportErrorModule ):
70
+ try :
71
+ pd .DataFrame ()
72
+ assert False
73
+ except ModuleNotFoundError :
74
+ pass
68
75
69
76
70
77
def test_lazy_attach ():
You can’t perform that action at this time.
0 commit comments