Commit 0fa87404 authored by fdeng@chromium.org's avatar fdeng@chromium.org

Make PyAuto functional tests compatible with python 2.7

Previously a pyauto functional test tries to restart itself with a correct version of python(i.e. 2.6) if it finds out the current python version is not 2.6. 
Make changes to pyauto_functional.py so that it will check the value of an environment variable DO_NOT_RESTART_PYTHON_FOR_PYAUTO when the test starts.
If DO_NOT_RESTART_PYTHON_FOR_PYAUTO is set (to any value), it will not try to restart itself regardless what the current python version is.

This is to allow users to run PyAuto with python 2.7. Users of python 2.7 can now run PyAuto functional tests by setting this environment variable (to any value).

BUG=None
TEST=Ran test_basic.py with DO_NOT_RESTART_PYTHON_FOR_PYAUTO set and unset.
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/10694077

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146284 0039d316-1c4b-4281-b951-d872f2087c98
parent 29bbdd31
#!/usr/bin/env python #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -77,7 +77,13 @@ def RunWithCorrectPythonIfNecessary(): ...@@ -77,7 +77,13 @@ def RunWithCorrectPythonIfNecessary():
RunAgain() RunAgain()
RunWithCorrectPythonIfNecessary() # Do not attempt to figure out python versions if
# DO_NOT_RESTART_PYTHON_FOR_PYAUTO is set.
if os.getenv('DO_NOT_RESTART_PYTHON_FOR_PYAUTO') is None:
RunWithCorrectPythonIfNecessary()
else:
print 'Will not try to restart with the correct version of python '\
'as DO_NOT_RESTART_PYTHON_FOR_PYAUTO is set.'
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment