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 88
99jobs :
1010 report :
11- runs-on : ubuntu-22.04
11+ runs-on : ubuntu-latest
1212 strategy :
1313 matrix :
1414 python-version : ["3.10"]
2323 run : |
2424 python -m pip install --upgrade pip wheel setuptools
2525 python -m pip install ".[test]"
26+ python -m pip install --upgrade numpy
27+ python -m pip uninstall --yes scipy
2628 pip list
2729
2830 - 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():
4949
5050
5151def test_lazy_import_nonbuiltins ():
52- sp = lazy .load ("scipy" )
5352 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 )
5456 if isinstance (sp , lazy .DelayedImportErrorModule ):
5557 try :
5658 sp .pi
5759 assert False
5860 except ModuleNotFoundError :
5961 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 )
6862
6963
7064def test_lazy_attach ():
You can’t perform that action at this time.
0 commit comments