diff options
author | DWesl <22566757+DWesl@users.noreply.github.com> | 2021-01-01 12:34:26 -0500 |
---|---|---|
committer | DWesl <22566757+DWesl@users.noreply.github.com> | 2021-01-01 12:38:04 -0500 |
commit | 2432ea3cbff7b467e9b948f893cca4111c8417c7 (patch) | |
tree | 92fda133501bd834f7b73bc6ee728271f91cd6c1 | |
parent | 31647f1b3e56c2f2a471cd2c3a583311534173f8 (diff) | |
download | numpy-2432ea3cbff7b467e9b948f893cca4111c8417c7.tar.gz |
TST: Avoid changing odd tempfile names in tests' site.cfg
CI once produced a tempfile name with the string 'mkl' embedded. The
old code changed this as well as the section name. This should ensure
only section names get changed, and the restriction on the number of
replacements should catch any weird corner cases, since I think the
sections came first.
-rw-r--r-- | numpy/distutils/tests/test_system_info.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/distutils/tests/test_system_info.py b/numpy/distutils/tests/test_system_info.py index ec15126f7..b722281ad 100644 --- a/numpy/distutils/tests/test_system_info.py +++ b/numpy/distutils/tests/test_system_info.py @@ -269,7 +269,7 @@ class TestSystemInfoReading: # But if we copy the values to a '[mkl]' section the value # is correct with open(cfg, 'r') as fid: - mkl = fid.read().replace('ALL', 'mkl') + mkl = fid.read().replace('[ALL]', '[mkl]', 1) with open(cfg, 'w') as fid: fid.write(mkl) info = mkl_info() @@ -277,7 +277,7 @@ class TestSystemInfoReading: # Also, the values will be taken from a section named '[DEFAULT]' with open(cfg, 'r') as fid: - dflt = fid.read().replace('mkl', 'DEFAULT') + dflt = fid.read().replace('[mkl]', '[DEFAULT]', 1) with open(cfg, 'w') as fid: fid.write(dflt) info = mkl_info() |