Fix race condition when Python 2 and Python 3 tests run in parallel

This commit is contained in:
Ray Speth 2015-06-19 11:53:26 -04:00
parent c446686c85
commit 1d7104a96b
2 changed files with 5 additions and 3 deletions

View file

@ -241,7 +241,7 @@ class TestFreeFlame(utilities.CanteraTest):
self.create_sim(p, Tin, reactants)
self.solve_fixed_T()
filename = 'onedim-fixed-T.xml'
filename = 'onedim-fixed-T{0}.xml'.format(utilities.python_version)
if os.path.exists(filename):
os.remove(filename)
@ -302,7 +302,7 @@ class TestFreeFlame(utilities.CanteraTest):
p = 2 * ct.one_atm
Tin = 400
filename = 'onedim-add-species.xml'
filename = 'onedim-add-species{0}.xml'.format(utilities.python_version)
if os.path.exists(filename):
os.remove(filename)
@ -330,7 +330,7 @@ class TestFreeFlame(utilities.CanteraTest):
p = 2 * ct.one_atm
Tin = 400
filename = 'onedim-add-species.xml'
filename = 'onedim-add-species{0}.xml'.format(utilities.python_version)
if os.path.exists(filename):
os.remove(filename)

View file

@ -4,6 +4,8 @@ import os
import warnings
_ver = sys.version_info[:2]
python_version = str(_ver[0])
if _ver < (2,7) or (3,0) <= _ver < (3,2):
# unittest2 is a backport of the new features added to the unittest
# testing framework in Python 2.7 and Python 3.2. See