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

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: Update path to LICENSE.txt of logilab/README.chromium Created 4 years, 7 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 | « content/test/gpu/PRESUBMIT.py ('k') | content/test/gpu/pylintrc » ('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 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 try:
20 from pylint import lint
21 except ImportError:
22 lint = None
23
24
25 _RC_FILE = os.path.join(path_util.GetGpuTestDir(), 'pylintrc')
26
27 def LintCheckPassed(directory):
28 args = [directory, '--rcfile=%s' % _RC_FILE]
29 try:
30 assert lint, 'pylint module cannot be found'
31 lint.Run(args)
32 assert False, (
33 'This should not be reached as lint.Run always raise SystemExit')
34 except SystemExit as err:
35 if err.code == 0:
36 return True
37 return False
38
39
40 class LintTest(unittest.TestCase):
41
42 def testPassingPylintCheckForGpuTestsDir(self):
43 self.assertTrue(LintCheckPassed(os.path.abspath(os.path.dirname(__file__))))
44
45 def testPassingPylintCheckForPageSetsDir(self):
46 self.assertTrue(LintCheckPassed(
47 os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'page_sets'
48 )))
OLDNEW
« no previous file with comments | « content/test/gpu/PRESUBMIT.py ('k') | content/test/gpu/pylintrc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698