'Tests marked with \'flaky\' are retried if they fail, and marked as
erroring / failing if they don\'t reach the minimum number of successes.'

@given(permutations([(lambda : throw(ValueError('failure'))), (lambda : None), (lambda : throw(RuntimeError('failure    #2')))]))
def test_intermittent_flaky_test_that_errors(self, test_methods):

    executions = iter(test_methods)
    class SomeTest(testtools.TestCase, ):
        run_tests_with = retry_flaky()
        @flaky(u'FLOC-XXXX', max_runs=len(test_methods), min_passes=2)
        def test_something(self):
            next(executions)()
    test = SomeTest('test_something')
    self.assertThat(run_test(test), has_results(tests_run=Equals(1), errors=HasLength(1)))
