def test_skip_after_fail_pfp(self): a = False b = False c = False with skip_after_fail(): @test() def _(): nonlocal a a = True @test() def _(): nonlocal b b = True fail() @test() def _(): nonlocal c c = True self.assertTrue(a) self.assertTrue(b) self.assertFalse(c)
def test_skip_after_fail_ppp(self): with keep_counts() as current_count, skip_after_fail(): @test() def _(): pass @test() def _(): pass @test() def _(): pass self.assertEqual(current_count(), Counts(3, 0, 0))
def test_skip_after_fail_pff(self): with keep_counts() as current_count, skip_after_fail(): @test() def _(): pass @test() def _(): fail() @test() def _(): fail() self.assertEqual(current_count(), Counts(1, 1, 1))
def test_continue_after_fail_inside_skip_after_fail_fpp(self): with keep_counts() as current_count, skip_after_fail( ), continue_after_fail(): @test() def _(): fail() @test() def _(): pass @test() def _(): pass self.assertEqual(current_count(), Counts(2, 1, 0))