'We sometimes subclass test classes in order to test different
implementations of the same interface. A test within such a subclass
can be marked as flaky, causing it to retry.'

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

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