From 3c28326317bde6e52c7607642ba76b641f91da88 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 31 Oct 2012 09:48:47 +0100 Subject: [PATCH] [DOC] test-framework: added note about setUp() throwing exceptions. bzr revid: vmt@openerp.com-20121031084847-fuwtnu8nmegphwqm --- doc/test-framework.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/test-framework.rst b/doc/test-framework.rst index f53d15ae0da..17a7b480640 100644 --- a/doc/test-framework.rst +++ b/doc/test-framework.rst @@ -104,3 +104,14 @@ TestCase subclasses .. automodule:: openerp.tests.common :members: + +.. note:: + + The `setUp` and `tearDown` methods are not part of the tests. Uncaught + exceptions in those methods are errors, not test failures. In particular, + a failing `setUp` will not be followed by a `tearDown` causing any + allocated resource in the `setUp` to not be released by the `tearDown`. + + In the :py:class:`openerp.tests.common.TransactionCase` and + :py:class:`openerp.tests.common.SingleTransactionCase`, this means the + test suite can hang because of unclosed cursors.