Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: appengine/monorail/.expect_tests_pretest.py

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/monorail/.expect_tests.cfg ('k') | appengine/monorail/.gitignore » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is govered by a BSD-style
3 # license that can be found in the LICENSE file or at
4 # https://developers.google.com/open-source/licenses/bsd
5
6 # pylint: disable=undefined-variable
7
8 import os
9 import sys
10
11 # Using pretest_filename is magic, because it is available in the locals() of
12 # the script which execfiles this file.
13 # prefixing with 'pretest' to avoid name collisions in expect_tests.
14 pretest_APPENGINE_ENV_PATH = os.path.join(
15 os.path.dirname(
16 os.path.dirname(
17 os.path.dirname(
18 os.path.dirname(
19 os.path.abspath(pretest_filename))))),
20 'google_appengine')
21 sys.path.append(pretest_APPENGINE_ENV_PATH)
22
23 # Crazy hack, because of appengine.
24 # Importing dev_appserver is probably not officially supported and fix_sys_path
25 # may be an implementation detail subject to change.
26 import dev_appserver as pretest_dev_appserver
27 pretest_dev_appserver.fix_sys_path()
28
29 # Remove google_appengine SDK from sys.path after use
30 sys.path.remove(pretest_APPENGINE_ENV_PATH)
31
32 SDK_LIBRARY_PATHS = [
33 # This is not added by fix_sys_path.
34 os.path.join(pretest_APPENGINE_ENV_PATH, 'lib', 'mox'),
35 ]
36 sys.path.extend(SDK_LIBRARY_PATHS)
37
38 os.environ['SERVER_SOFTWARE'] = 'test ' + os.environ.get('SERVER_SOFTWARE', '')
39 os.environ['CURRENT_VERSION_ID'] = 'test.123'
OLDNEW
« no previous file with comments | « appengine/monorail/.expect_tests.cfg ('k') | appengine/monorail/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698