diff options
| author | Rohit Goswami <rog32@hi.is> | 2022-05-27 23:57:35 +0000 |
|---|---|---|
| committer | Rohit Goswami <rog32@hi.is> | 2022-05-28 00:03:02 +0000 |
| commit | 2d6341542d6888cd9811961de296dbacee6cc4be (patch) | |
| tree | b484117671b4acb10ece55555907b2649e93089a /numpy/f2py/tests/util.py | |
| parent | 393741878fdc3a0b93fb615c306aa2fa90139833 (diff) | |
| download | numpy-2d6341542d6888cd9811961de296dbacee6cc4be.tar.gz | |
TST: Handle compiler checks for PYF
Diffstat (limited to 'numpy/f2py/tests/util.py')
| -rw-r--r-- | numpy/f2py/tests/util.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py index 66e5505c6..ae81bbfc4 100644 --- a/numpy/f2py/tests/util.py +++ b/numpy/f2py/tests/util.py @@ -344,10 +344,6 @@ class F2PyTest: # Check compiler availability first if not has_c_compiler(): pytest.skip("No C compiler available") - if not has_f77_compiler(): - pytest.skip("No Fortran 77 compiler available") - if not has_f90_compiler(): - pytest.skip("No Fortran 90 compiler available") codes = [] if self.sources: @@ -357,11 +353,20 @@ class F2PyTest: needs_f77 = False needs_f90 = False + needs_pyf = False for fn in codes: if str(fn).endswith(".f"): needs_f77 = True elif str(fn).endswith(".f90"): needs_f90 = True + elif str(fn).endswith(".pyf"): + needs_pyf = True + if needs_f77 and not has_f77_compiler(): + pytest.skip("No Fortran 77 compiler available") + if needs_f90 and not has_f90_compiler(): + pytest.skip("No Fortran 90 compiler available") + if needs_pyf and not (has_f90_compiler() or has_f77_compiler()): + pytest.skip("No Fortran compiler available") # Build the module if self.code is not None: |
