'In a TestCase, a test method which is a generator function is reported
as an error, as such a method will never run assertions.'

def test_errorOnGeneratorFunction(self):

    class GeneratorTestCase(unittest.TestCase, ):
        '\n                                                A    fake    TestCase    for    testing    purposes.\n                                                '
        def test_generator(self):
            '\n                                                                A    method    which    is    also    a    generator    function,    for    testing\n                                                                purposes.\n                                                                '
            self.fail('this    should    never    be    reached')
            (yield)
    testCase = GeneratorTestCase('test_generator')
    result = reporter.TestResult()
    testCase.run(result)
    self.assertEqual(len(result.failures), 0)
    self.assertEqual(len(result.errors), 1)
    self.assertIn('GeneratorTestCase.test_generator', result.errors[0][1].value.args[0])
    self.assertIn('GeneratorTestCase    testMethod=test_generator', result.errors[0][1].value.args[0])
    self.assertIn('is    a    generator    function    and    therefore    will    never    run', result.errors[0][1].value.args[0])
