Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 659751b

Browse files
HaoZekecharris
authored andcommitted
TST: Ensure f2py defaults are tested
1 parent 2b9fb88 commit 659751b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

numpy/f2py/tests/test_f2py2e.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import textwrap, re, sys, subprocess, shlex
22
from pathlib import Path
33
from collections import namedtuple
4+
import platform
45

56
import pytest
67

@@ -197,6 +198,20 @@ def test_gen_pyf_no_overwrite(capfd, hello_world_f90, monkeypatch):
197198
assert "Use --overwrite-signature to overwrite" in err
198199

199200

201+
@pytest.mark.skipif((platform.system() != 'Linux') and (sys.version_info <= (3, 12)), reason='Compiler and 3.12 required')
202+
def test_untitled_cli(capfd, hello_world_f90, monkeypatch):
203+
"""Check that modules are named correctly
204+
205+
CLI :: defaults
206+
"""
207+
ipath = Path(hello_world_f90)
208+
monkeypatch.setattr(sys, "argv", f"f2py --backend meson -c {ipath}".split())
209+
with util.switchdir(ipath.parent):
210+
f2pycli()
211+
out, _ = capfd.readouterr()
212+
assert "untitledmodule.c" in out
213+
214+
200215
@pytest.mark.xfail
201216
def test_f2py_skip(capfd, retreal_f77, monkeypatch):
202217
"""Tests that functions can be skipped

0 commit comments

Comments
 (0)