def tearDown(self): self._teardown(); super(TestCase, self).tearDown() ## permutations if len(GUP_EXES) > 1 and self.invocation_count > 1: test_method = getattr(self, self._testMethodName) if getattr(test_method, 'skip_permutations', None) is _skip_permutation_sentinel: return log.debug("running permutations based on %s invocations ..." % self.invocation_count) print("", file=sys.stderr) gup_exe_sequences = list(itertools.product(GUP_EXES, repeat=self.invocation_count)) for sequence in gup_exe_sequences: if all([exe == GUP_EXES[0] for exe in sequence]): # this is what the first test run does; skip it continue permutation_desc = [path.split(os.path.sep)[-3] for path in sequence] print("-- PERMUTATION: %r" % (permutation_desc,), file=sys.stderr) log.info("\n\n-----------------------\nPERMUTATION: %r", permutation_desc) self.exes = iter(sequence) self.setUp() try: test_method() finally: self._teardown() #XXX hack mocktest._teardown()
def run_suite(self, class_): mocktest._teardown() suite = unittest.makeSuite(class_) result = unittest.TestResult() suite.run(result) ret = result mocktest._setup() return result
def test_invalid_usage_after_teardown(self): mocktest._teardown() e = None try: mock_wrapper() except Exception, e_: e = e_
def tearDown(self): print "all expectations is %r" % (mocktest.mock.MockWrapper._all_expectations,) mocktest._teardown()
def downup(self): mocktest._teardown() mocktest._setup()