diff options
author | Mats Wichmann <mats@linux.com> | 2019-03-29 17:39:46 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-03-29 17:57:10 (GMT) |
commit | f439ae8a8c3aa53219cc0ef7741da106902f778c (patch) | |
tree | 115c3e037f443f313978a577cc765ecd43e1549c /test | |
parent | f4090a380132898099199a9ae23c0cfabdcc921f (diff) | |
download | SCons-f439ae8a8c3aa53219cc0ef7741da106902f778c.zip SCons-f439ae8a8c3aa53219cc0ef7741da106902f778c.tar.gz SCons-f439ae8a8c3aa53219cc0ef7741da106902f778c.tar.bz2 |
[PR #333] close files to avoid scons-time races
With runtest now honoring the -j 2 option given to it in
CI setup on Windows, there were some problems where scons-time
tests could try to remove a test directory while some files
in it were still open (these locations were complained about
by Python 3.8 also).
Switch test framework to using mkdtemp also, and to not use
tempfile.template (usage of that and mktemp are long
deprecated)
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/scons-time/run/config/initial_commands.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/scons-time/run/config/initial_commands.py b/test/scons-time/run/config/initial_commands.py index 167ed49..58d777a 100644 --- a/test/scons-time/run/config/initial_commands.py +++ b/test/scons-time/run/config/initial_commands.py @@ -38,7 +38,8 @@ test.write_sample_project('foo.tar.gz') test.write('config', """\ def touch(arg): - open(arg, 'w') + with open(arg, 'w'): + pass initial_commands = [(touch, 'touch %%%%s', r'%s')] """ % test.workpath('INITIAL')) |