summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/distutils/tests/test_fcompiler.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/numpy/distutils/tests/test_fcompiler.py b/numpy/distutils/tests/test_fcompiler.py
index f83b0a13b..ba19a97ea 100644
--- a/numpy/distutils/tests/test_fcompiler.py
+++ b/numpy/distutils/tests/test_fcompiler.py
@@ -52,8 +52,10 @@ def test_fcompiler_flags_append_warning(monkeypatch):
# non-empty flags to start with (otherwise the "if var and append" check
# will always be false).
try:
- fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95')
- fc.customize()
+ with suppress_warnings() as sup:
+ sup.record()
+ fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95')
+ fc.customize()
except numpy.distutils.fcompiler.CompilerNotFound:
pytest.skip("gfortran not found, so can't execute this test")
@@ -62,7 +64,10 @@ def test_fcompiler_flags_append_warning(monkeypatch):
for opt, envvar in customizable_flags:
new_flag = '-dummy-{}-flag'.format(opt)
- prev_flags = getattr(fc.flag_vars, opt)
+ with suppress_warnings() as sup:
+ sup.record()
+ prev_flags = getattr(fc.flag_vars, opt)
+
monkeypatch.setenv(envvar, new_flag)
with suppress_warnings() as sup:
sup.record()