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

Side by Side Diff: expect_tests/type_definitions.py

Issue 449293002: Don't try to strip NoneType expect_dirs (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests@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 | « no previous file | 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 inspect 5 import inspect
6 import os 6 import os
7 import re 7 import re
8 8
9 from collections import namedtuple 9 from collections import namedtuple
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 """ 181 """
182 breakpoints = breakpoints or [] 182 breakpoints = breakpoints or []
183 if not breakpoints or break_funcs: 183 if not breakpoints or break_funcs:
184 for f in (break_funcs or (func_call.func,)): 184 for f in (break_funcs or (func_call.func,)):
185 if hasattr(f, 'im_func'): 185 if hasattr(f, 'im_func'):
186 f = f.im_func 186 f = f.im_func
187 breakpoints.append((f.func_code.co_filename, 187 breakpoints.append((f.func_code.co_filename,
188 f.func_code.co_firstlineno, 188 f.func_code.co_firstlineno,
189 f.func_code.co_name)) 189 f.func_code.co_name))
190 190
191 expect_dir = expect_dir.rstrip('/') 191 if expect_dir:
192 expect_dir = expect_dir.rstrip('/')
192 return super(Test, cls).__new__(cls, name, func_call, expect_dir, 193 return super(Test, cls).__new__(cls, name, func_call, expect_dir,
193 expect_base, ext, covers, breakpoints) 194 expect_base, ext, covers, breakpoints)
194 195
195 196
196 @staticmethod 197 @staticmethod
197 def covers_obj(obj): 198 def covers_obj(obj):
198 test_file = inspect.getabsfile(obj) 199 test_file = inspect.getabsfile(obj)
199 covers = [test_file] 200 covers = [test_file]
200 match = Test.TEST_COVERS_MATCH.match(test_file) 201 match = Test.TEST_COVERS_MATCH.match(test_file)
201 if match: 202 if match:
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 print 'UNHANDLED:', obj 425 print 'UNHANDLED:', obj
425 return Failure() 426 return Failure()
426 427
427 def finalize(self, aborted): 428 def finalize(self, aborted):
428 """Called after __call__() has been called for all results. 429 """Called after __call__() has been called for all results.
429 430
430 @param aborted: True if the user aborted the run. 431 @param aborted: True if the user aborted the run.
431 @type aborted: bool 432 @type aborted: bool
432 """ 433 """
433 pass 434 pass
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698