test isolation: default ignores & repository acquisition

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Sep 17 20:10:02 BST 2009


>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

<snip/>

    jam> The problem I've had trying to do that is that then I end up with:

    jam> class TestFunctionFoo(TestCase):


    jam> class TestFunctionFooOnDisk(TestCaseInTempDir):


    jam> Which never really sat well with me. Maybe it is the 'right way', but it
    jam> seemed better to me to have:

    jam> class TestFunctionFoo(Test...):

    jam>  def test_aspect_on_disk(self):
    jam>     self.do_setup_on_disk()
    jam>     ...

    jam>  def test_aspect(self):
    jam>     self.do_setup_in_memory()
    jam>     ...

Exactly what I pointed in an another mail, the tests shouldn't
start with a local setup if that could be factored out at the
class level, thanks for demonstrating my point.

Having setUp() methods makes smaller and more readable
tests. Smaller tests provides better defect localization, by
design.

       Vincent



More information about the bazaar mailing list