|
4 | 4 | import platform
|
5 | 5 |
|
6 | 6 | import pytest
|
| 7 | +import warnings |
7 | 8 |
|
8 | 9 | from . import util
|
| 10 | +from numpy.testing import assert_warns |
9 | 11 | from numpy.f2py.f2py2e import main as f2pycli
|
| 12 | +from numpy.exceptions import VisibleDeprecationWarning |
10 | 13 |
|
11 | 14 | #########################
|
12 | 15 | # CLI utils and classes #
|
@@ -198,16 +201,20 @@ def test_gen_pyf_no_overwrite(capfd, hello_world_f90, monkeypatch):
|
198 | 201 | assert "Use --overwrite-signature to overwrite" in err
|
199 | 202 |
|
200 | 203 |
|
201 |
| -@pytest.mark.skipif((platform.system() != 'Linux') and (sys.version_info <= (3, 12)), reason='Compiler and 3.12 required') |
| 204 | +@pytest.mark.skipif(platform.system() != 'Linux', reason = "Needs a compiler") |
| 205 | +@pytest.mark.filterwarnings("ignore") |
202 | 206 | def test_untitled_cli(capfd, hello_world_f90, monkeypatch):
|
203 | 207 | """Check that modules are named correctly
|
204 | 208 |
|
205 | 209 | CLI :: defaults
|
206 | 210 | """
|
| 211 | + # Will show up on < 3.12 |
| 212 | + warnings.filterwarnings('error', '', VisibleDeprecationWarning) |
207 | 213 | ipath = Path(hello_world_f90)
|
208 |
| - monkeypatch.setattr(sys, "argv", f"f2py --backend meson -c {ipath}".split()) |
| 214 | + monkeypatch.setattr(sys, "argv", f"f2py -c {ipath}".split()) |
209 | 215 | with util.switchdir(ipath.parent):
|
210 |
| - f2pycli() |
| 216 | + with assert_warns(UserWarning): |
| 217 | + f2pycli() |
211 | 218 | out, _ = capfd.readouterr()
|
212 | 219 | assert "untitledmodule.c" in out
|
213 | 220 |
|
|
0 commit comments