summaryrefslogtreecommitdiff
path: root/numpy/distutils/tests
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2018-12-27 23:32:09 -0800
committerRalf Gommers <ralf.gommers@gmail.com>2018-12-27 23:32:09 -0800
commit659ffb0a4ebe9e516568bd5d914e7f1f47513dff (patch)
tree60d88ceea79d259bec308ddc0d6e9318c02146a2 /numpy/distutils/tests
parent004a6c14e3ac4855dabfff91a56d35bc5a67266a (diff)
downloadnumpy-659ffb0a4ebe9e516568bd5d914e7f1f47513dff.tar.gz
TST: suppress test warnings for appending flag behavior better.
Diffstat (limited to 'numpy/distutils/tests')
-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()