garybernhardt/dingus — pull request #15 by jaraco (2012-02-20 19:52:56+00:00)
Title: Extract TestCase to enable override for use by other test runners

We use Dingus with pytest, which doesn't recognize the setup/teardown methods in TestCase, so we have a convoluted way to customize the DingusTestCase factory.

This changeset exposes the TestCase class so it can be customized in a straightforward fashion by third-party module. For example:

```
class PyTestCase(dingus.TestCase):
def setup_method(self, method):
self.setup()

def teardown_method(self, method):
self.teardown()

class SomeTestCase(dingus.DingusTestCase(my_module.my_obj, base=PyTestCase)):
"test my_obj"
```

This changeset also has the effect of making object_under_test, names_under_test, and excludes available as class attributes on the generated DingusTestCase.

This changeset also makes a couple of simple improvements:
- Use list comprehension instead of generator for calculating names_under_test, and
- Use type() to explicitly generate the class rather than using a closure

I believe this change should be fully backward-compatible, and all tests still pass.