presubmit: Run tests on Windows.

Change-Id: Ia6844cd6da6a9c68ed3d83144bd032933ab69fcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1875110
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
changes/10/1875110/3
Edward Lesmes 6 years ago committed by Commit Bot
parent dc4d19eeb6
commit a51a06699f

@ -79,7 +79,6 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
r'.*git_number_test\.py$',
r'.*git_rebase_update_test\.py$',
r'.*ninjalog_uploader_test\.py$',
r'.*presubmit_unittest\.py$',
r'.*recipes_test\.py$',
r'.*roll_dep_test\.py$',
r'.*scm_unittest\.py$',

@ -917,7 +917,7 @@ class InputApiUnittest(PresubmitTestsBase):
known_files = []
for _, f, exists in files:
full_file = os.path.join(self.fake_root_dir, f)
if exists and f.startswith('foo/'):
if exists and f.startswith('foo'):
known_files.append(full_file)
diffs.append(self.presubmit_diffs % {'filename': f})
@ -2078,8 +2078,8 @@ the current line as well!
input_api.environ = mock.MagicMock(os.environ)
input_api.environ.copy.return_value = {}
input_api.AffectedSourceFiles.return_value = True
input_api.PresubmitLocalPath.return_value = '/foo'
input_api.os_walk.return_value = [('/foo', [], ['file1.py'])]
input_api.PresubmitLocalPath.return_value = 'CWD'
input_api.os_walk.return_value = [('CWD', [], ['file1.py'])]
process = mock.Mock()
process.returncode = 0
@ -2088,7 +2088,9 @@ the current line as well!
pylint = os.path.join(_ROOT, 'pylint')
pylintrc = os.path.join(_ROOT, 'pylintrc')
env = {'PYTHONPATH': ''}
env = {str('PYTHONPATH'): str('')}
if sys.platform == 'win32':
pylint += '.bat'
results = presubmit_canned_checks.RunPylint(
input_api, presubmit.OutputApi)
@ -2097,11 +2099,11 @@ the current line as well!
self.assertEqual(subprocess.Popen.mock_calls, [
mock.call(
[pylint, '--args-on-stdin'], env=env,
cwd='/foo', stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
cwd='CWD', stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
stdin=subprocess.PIPE),
mock.call(
[pylint, '--args-on-stdin'], env=env,
cwd='/foo', stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
cwd='CWD', stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
stdin=subprocess.PIPE),
])
self.assertEqual(presubmit.sigint_handler.wait.mock_calls, [

Loading…
Cancel
Save