zope.testing and unittest2

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hi,

Has anyone given any thought to supporting the new constructs of 
unittest2 (http://pypi.python.org/pypi/unittest2) in zope.testing?

Using zope.testing 3.9.3 and a simple test case with unittest2, I made 
the following observations:

  - A basic test case works fine; a subclass of unittest2.TestCase is 
picked up for tests

  - The new assertions work.

  - The @skip, @skipIf, @skipUnless and @expectedFailure decorators 
work. However, there is a deprecation warning: "Use of a TestResult 
without an addExpectedFailure method is deprecated". In the output, 
zope.testing reports "Ran 2 tests with 0 failures and 0 errors" when 
running one skipped and one passing test.

  - setUpClass()/tearDownClass() methods are not executed

  - Neither are setUpModule()/tearDownModule() methods

Overall, it seems that we'd need to:

  - Make zope.testing aware of skipped tests and report these separately.

  - Call the class and module level fixture methods. I'm not entirely 
sure how these would interact with layers.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.