Commit 0927b7ee authored by maruel@chromium.org's avatar maruel@chromium.org

Create a new testing_support module to move utility modules there

It will simplify importing utility modules from other projects. Otherwise I was getting name conflicts with 'test'.

Reenable W0403 that was disabled in the previous CL.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8508015

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109636 0039d316-1c4b-4281-b951-d872f2087c98
parent a9c7d6f3
......@@ -6,7 +6,7 @@
/svn.bat
/svn_bin
/svnversion.bat
/tests/_rietveld
/depot_tools_testing_lib/_rietveld
/tests/subversion_config/README.txt
/tests/subversion_config/auth
/tests/subversion_config/servers
......@@ -29,7 +29,7 @@ def CommonChecks(input_api, output_api, tests_to_black_list):
r'^cpplint_chromium\.py$',
r'^python_bin[\/\\].+',
r'^svn_bin[\/\\].+',
r'^tests[\/\\]\w+?[\/\\].+']
r'^testing_support[\/\\]_rietveld[\/\\].+']
results.extend(input_api.canned_checks.RunPylint(
input_api,
output_api,
......@@ -59,7 +59,7 @@ def RunGitClTests(input_api, output_api):
old_sys_path = sys.path
try:
sys.path = [input_api.PresubmitLocalPath()] + sys.path
from tests import local_rietveld # pylint: disable=W0403
from testing_support import local_rietveld
server = local_rietveld.LocalRietveld()
finally:
sys.path = old_sys_path
......
......@@ -57,14 +57,13 @@ load-plugins=
# W0141: Used builtin function ''
# W0142: Used * or ** magic
# W0402: Uses of a deprecated module 'string'
# W0403: Relative import 'X', should be 'Y.X'
# W0404: 41: Reimport 'XX' (imported line NN)
# W0511: TODO
# W0603: Using the global statement
# W0613: Unused argument ''
# W0703: Catch "Exception"
# W1201: Specify string format arguments as logging function parameters
disable=C0103,C0111,C0302,I0010,I0011,R0401,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0402,W0403,W0404,W0511,W0603,W0613,W0703,W1201
disable=C0103,C0111,C0302,I0010,I0011,R0401,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0402,W0404,W0511,W0603,W0613,W0703,W1201
[REPORTS]
......
......@@ -18,7 +18,7 @@ import tempfile
import time
# trial_dir must be first for non-system libraries.
from tests import trial_dir
from testing_support import trial_dir
import gclient_utils
import scm
import subprocess2
......
......@@ -16,7 +16,6 @@ import socket
import sys
import time
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import subprocess2
......
......@@ -90,8 +90,9 @@ class StdoutCheck(object):
def setUp(self):
# Override the mock with a StringIO, it's much less painful to test.
self._old_stdout = sys.stdout
sys.stdout = StringIO.StringIO()
sys.stdout.flush = lambda: None
stdout = StringIO.StringIO()
stdout.flush = lambda: None
sys.stdout = stdout
def tearDown(self):
try:
......
......@@ -10,7 +10,7 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import SuperMoxTestBase
from testing_support.super_mox import SuperMoxTestBase
import breakpad
......
......@@ -16,11 +16,12 @@ from xml.etree import ElementTree
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(ROOT_DIR))
from testing_support import fake_repos
from testing_support.patches_data import GIT, RAW
import checkout
import patch
import subprocess2
from tests import fake_repos
from tests.patches_data import GIT, RAW
# pass -v to enable it.
......
......@@ -12,7 +12,7 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import mox, SuperMoxTestBase
from testing_support.super_mox import mox, SuperMoxTestBase
import gcl
import presubmit_support
......
......@@ -21,8 +21,8 @@ import __builtin__
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import mox, StdoutCheck, SuperMoxTestBase
from super_mox import TestCaseUtils
from testing_support.super_mox import mox, StdoutCheck, SuperMoxTestBase
from testing_support.super_mox import TestCaseUtils
import gclient_scm
import subprocess2
......
......@@ -20,7 +20,7 @@ import unittest
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR)
from fake_repos import join, write, FakeReposTestBase
from testing_support.fake_repos import join, write, FakeReposTestBase
import subprocess2
......
......@@ -19,7 +19,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import gclient
import gclient_utils
from tests import trial_dir
from testing_support import trial_dir
def write(filename, content):
......
......@@ -9,8 +9,8 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import SuperMoxTestBase
import trial_dir
from testing_support.super_mox import SuperMoxTestBase
from testing_support import trial_dir
import gclient_utils
import subprocess2
......
......@@ -11,8 +11,9 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from testing_support import filesystem_mock
import owners
from tests import filesystem_mock
ben = 'ben@example.com'
brett = 'brett@example.com'
......
......@@ -13,8 +13,9 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from testing_support.patches_data import GIT, RAW
import patch
from tests.patches_data import GIT, RAW
class PatchTest(unittest.TestCase):
......
......@@ -15,7 +15,7 @@ import time
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import mox, SuperMoxTestBase
from testing_support.super_mox import mox, SuperMoxTestBase
import owners
import presubmit_support as presubmit
......
......@@ -12,9 +12,10 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from testing_support.patches_data import GIT, RAW
import patch
import rietveld
from tests.patches_data import GIT, RAW
def _api(files):
......
......@@ -13,9 +13,9 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import SuperMoxTestBase
from testing_support import fake_repos
from testing_support.super_mox import SuperMoxTestBase
import fake_repos
import scm
import subprocess2
......
......@@ -10,7 +10,7 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from super_mox import SuperMoxTestBase
from testing_support.super_mox import SuperMoxTestBase
import subprocess2
import trychange
......
......@@ -12,7 +12,8 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import super_mox
from testing_support import super_mox
import watchlists
......
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