'A flaky test always errors out is recorded as erroring.'

@given(jira_keys, num_runs, num_runs)
def test_always_erroring_flaky_test(self, jira_keys, max_runs, min_passes):

    [min_passes, max_runs] = sorted([min_passes, max_runs])
    executions = repeat((lambda : throw(ValueError('failure'))))
    class SomeTest(testtools.TestCase, ):
        run_tests_with = retry_flaky()
        @flaky(jira_keys, max_runs=max_runs, min_passes=min_passes)
        def test_something(self):
            next(executions)()
    test = SomeTest('test_something')
    result = run_test(test)
    self.expectThat(result, has_results(errors=HasLength(1), tests_run=Equals(1)))
    [(_, exception)] = result.errors
    flaky_data = _get_flaky_annotation(test).to_dict()
    flaky_data.update({'runs': ((max_runs - min_passes) + 1), 'passes': 0})
    self.assertThat(exception, MatchesAll(Contains('ValueError'), Contains(pformat(flaky_data))))
