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

Side by Side Diff: content/test/gpu/gpu_tests/lint_unittest.py

Issue 1920403002: [content/test/gpu] Run pylint check of gpu tests in unittest instead of PRESUBMIT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6 import os
7
8 from gpu_tests import path_util
9
10 path_util.AddDirToPathIfNeeded(
11 path_util.GetChromiumSrcDir(), 'third_party', 'logilab')
12
13 path_util.AddDirToPathIfNeeded(
14 path_util.GetChromiumSrcDir(), 'third_party', 'logilab', 'logilab')
15
16 path_util.AddDirToPathIfNeeded(
17 path_util.GetChromiumSrcDir(), 'third_party', 'pylint')
18
19 from pylint import lint
20
21
22 _RC_FILE = os.path.join(path_util.GetGpuTestDir(), 'pylintrc')
23 def LintCheckPassed(directory):
24 args = [directory, '--rcfile=%s' % _RC_FILE]
25 try:
26 lint.Run(args)
27 assert False, (
28 'This should not be reached as lint.Run always raise SystemExit')
29 except SystemExit as err:
30 if err.code == 0:
31 return True
32 return False
33
34 class LintTest(unittest.TestCase):
35
36 def testPassingPylintCheckForGpuTestsDir(self):
37 self.assertTrue(LintCheckPassed(os.path.abspath(os.path.dirname(__file__))))
38
39 def testPassingPylintCheckForPageSetsDir(self):
40 self.assertTrue(LintCheckPassed(
41 os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'page_sets'
42 )))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698