Check that distutils backend and related options fail CLI :: --fcompiler --help-link --backend distutils
(capfd, hello_world_f90, monkeypatch)
| 236 | |
| 237 | @pytest.mark.slow |
| 238 | def test_no_distutils_backend(capfd, hello_world_f90, monkeypatch): |
| 239 | """Check that distutils backend and related options fail |
| 240 | CLI :: --fcompiler --help-link --backend distutils |
| 241 | """ |
| 242 | MNAME = "hi" |
| 243 | foutl = get_io_paths(hello_world_f90, mname=MNAME) |
| 244 | ipath = foutl.f90inp |
| 245 | monkeypatch.setattr( |
| 246 | sys, "argv", f"f2py {ipath} -c --fcompiler=gfortran -m {MNAME}".split() |
| 247 | ) |
| 248 | with util.switchdir(ipath.parent): |
| 249 | compiler_check_f2pycli() |
| 250 | out, _ = capfd.readouterr() |
| 251 | assert "--fcompiler cannot be used with meson" in out |
| 252 | |
| 253 | monkeypatch.setattr( |
| 254 | sys, "argv", ["f2py", "--help-link"] |
| 255 | ) |
| 256 | with pytest.raises(SystemExit): |
| 257 | f2pycli() |
| 258 | out, _ = capfd.readouterr() |
| 259 | assert "Unknown option --help-link" in out |
| 260 | |
| 261 | monkeypatch.setattr( |
| 262 | sys, "argv", ["f2py", "--backend", "distutils"] |
| 263 | ) |
| 264 | with pytest.raises(SystemExit): |
| 265 | compiler_check_f2pycli() |
| 266 | f2pycli() |
| 267 | out, _ = capfd.readouterr() |
| 268 | assert "'distutils' backend was removed" in out |
| 269 | |
| 270 | @pytest.mark.xfail |
| 271 | def test_f2py_skip(capfd, retreal_f77, monkeypatch): |
nothing calls this directly
no test coverage detected
searching dependent graphs…