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

Side by Side Diff: expect_tests/main.py

Issue 466043003: Make expect_tests not try to be smart about pyc. (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests.git@master
Patch Set: Created 6 years, 4 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 | « expect_tests/__init__.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import argparse 5 import argparse
6 import collections 6 import collections
7 import multiprocessing 7 import multiprocessing
8 import pkgutil 8 import pkgutil
9 import sys 9 import sys
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 for _, modname, ispkg in pkgutil.walk_packages(path=['.']): 152 for _, modname, ispkg in pkgutil.walk_packages(path=['.']):
153 if any(modname.startswith(pkg) for pkg in blacklist): 153 if any(modname.startswith(pkg) for pkg in blacklist):
154 continue 154 continue
155 if ispkg: 155 if ispkg:
156 submods = getattr(load_module(modname), '__expect_tests_skip', None) 156 submods = getattr(load_module(modname), '__expect_tests_skip', None)
157 if isinstance(submods, collections.Iterable): 157 if isinstance(submods, collections.Iterable):
158 for submod in submods: 158 for submod in submods:
159 blacklist.add('.'.join([modname, submod])) 159 blacklist.add('.'.join([modname, submod]))
160 continue 160 continue
161 if modname.endswith('_test'): 161 if modname.endswith('_test'):
162 m = load_module(modname) 162 ret.append(load_module(modname))
163 if m.__file__.endswith('.py'):
164 ret.append(m)
165 163
166 return ret 164 return ret
167 165
168 166
169 def get_test_gens(test_modules): 167 def get_test_gens(test_modules):
170 if test_modules is ALL_MODULES: 168 if test_modules is ALL_MODULES:
171 test_modules = find_all_modules() 169 test_modules = find_all_modules()
172 assert isinstance(test_modules, list) 170 assert isinstance(test_modules, list)
173 171
174 test_gens = [] 172 test_gens = []
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 cover_ctx.cleanup() 222 cover_ctx.cleanup()
225 if (not killed and 223 if (not killed and
226 not skip_loop and ( 224 not skip_loop and (
227 opts.force_coverage or not opts.test_glob)): 225 opts.force_coverage or not opts.test_glob)):
228 if not cover_ctx.report(opts.verbose): 226 if not cover_ctx.report(opts.verbose):
229 sys.exit(2) 227 sys.exit(2)
230 228
231 sys.exit(error or killed) 229 sys.exit(error or killed)
232 except KeyboardInterrupt: 230 except KeyboardInterrupt:
233 pass 231 pass
OLDNEW
« no previous file with comments | « expect_tests/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698