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

Side by Side Diff: testing_support/auto_stub.py

Issue 956363004: Clean up, smoke tests (Closed) Base URL: https://chromium.googlesource.com/infra/testing/testing_support.git@master
Patch Set: Created 5 years, 10 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 | testing_support/fake_repos.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 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 collections 5 import collections
6 import inspect 6 import inspect
7 import unittest 7 import unittest
8 8
9 9
10 class AutoStubMixIn(object): 10 class AutoStubMixIn(object):
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 str_kwargs = ', '.join('%s=%r' % (k, v) for k, v in kwargs.iteritems()) 61 str_kwargs = ', '.join('%s=%r' % (k, v) for k, v in kwargs.iteritems())
62 self.calls.append('%s(%s)' % ( 62 self.calls.append('%s(%s)' % (
63 caller_name, ', '.join(filter(None, [str_args, str_kwargs])))) 63 caller_name, ', '.join(filter(None, [str_args, str_kwargs]))))
64 64
65 65
66 class TestCase(unittest.TestCase, AutoStubMixIn): 66 class TestCase(unittest.TestCase, AutoStubMixIn):
67 """Adds self.mock() and self.has_failed() to a TestCase.""" 67 """Adds self.mock() and self.has_failed() to a TestCase."""
68 def tearDown(self): 68 def tearDown(self):
69 AutoStubMixIn.tearDown(self) 69 AutoStubMixIn.tearDown(self)
70 unittest.TestCase.tearDown(self) 70 unittest.TestCase.tearDown(self)
71
72 def has_failed(self):
73 """Returns True if the test has failed."""
74 return not self._resultForDoCleanups.wasSuccessful()
OLDNEW
« no previous file with comments | « no previous file | testing_support/fake_repos.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698