Skip to content

Commit

Permalink
Fix race condition when Python 2 and Python 3 tests run in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Jun 19, 2015
1 parent c446686 commit 1d7104a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interfaces/cython/cantera/test/test_onedim.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def test_save_restore(self):

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)

Expand Down Expand Up @@ -302,7 +302,7 @@ def test_save_restore_add_species(self):
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)

Expand Down Expand Up @@ -330,7 +330,7 @@ def test_save_restore_remove_species(self):
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)

Expand Down
2 changes: 2 additions & 0 deletions interfaces/cython/cantera/test/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
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
Expand Down

0 comments on commit 1d7104a

Please sign in to comment.