On Tue, Feb 9, 2010 at 12:57 PM, Antoine Pitrou <solip...@pitrou.net> wrote: > Le Tue, 09 Feb 2010 16:42:50 +0000, Michael Foord a écrit : >> >> The next 'big' change to unittest will (may?) be the introduction of >> class and module level setUp and tearDown. This was discussed on >> Python-ideas and Guido supported them. They can be useful but are also >> very easy to abuse (too much shared state, monolithic test classes and >> modules). Several authors of other Python testing frameworks spoke up >> *against* them, but several *users* of test frameworks spoke up in >> favour of them. ;-) > > One problem is that it is not obvious what happens with inheritance. > If I have a class-level setUp for class B, and class C inherits from B, > will there be a separate invocation of setUp for C, or not? > (I guess both possibilities have use cases) >
Considering JUnit : - The @BeforeClass methods of superclasses will be run before those the current class. - The @AfterClass methods declared in superclasses will be run after those of the current class. However considering that PyUnit is not based on annotations, isn't it possible to specify that explicitly (and assume super-class method not called by default) ? -- Regards, Olemis. Blog ES: http://simelo-es.blogspot.com/ Blog EN: http://simelo-en.blogspot.com/ Featured article: gmane.comp.version-control.subversion.trac.general - http://feedproxy.google.com/~r/TracGViz-full/~3/SLY6s0RazcA/28067 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com