test-utils
test-utils copied to clipboard
Need a way to skip fixture bundling
Right now, the django-nose fixture bundling amends a group of tests like this:
TestFoo._fb_should_setup_fixtures = True # first
TestBaz._fb_should_setup_fixtures = False
TestBar._fb_should_setup_fixtures = False
FastFixtureTestCase checks for those values. So how do you create a fixture test case that should not be bundled? Let's say you make TestFoo inherit from an old slow class like django.test.TestCase in an effort to take it out of the fixture bundle. test-utils doesn't care. This scenario will actually mess everything up because no fixtures will be loaded at all.
I think the bundle plugin should look for something like TestFoo._do_not_bundle = True
or it needs to check that the test case is a subclass of FastFixtureTestCase. Then the plugin can make sure this kind of test doesn't ever get elected as first in the group.
For a concrete example, TestFoo is a test in AMO that needs to inherit from ESTestCase which cannot use FastFixtureTestCase.