From c902eb4539fae8035a243dd54e2f60f95c8484a8 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 30 Oct 2012 12:37:37 +0100 Subject: [PATCH] [DOC] openerp.tests.common: now included in the test-framework page. bzr revid: vmt@openerp.com-20121030113737-10h045k368pbrldq --- doc/test-framework.rst | 12 +++++++++--- openerp/tests/common.py | 8 ++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/test-framework.rst b/doc/test-framework.rst index 56951b1..f53d15a 100644 --- a/doc/test-framework.rst +++ b/doc/test-framework.rst @@ -87,9 +87,9 @@ In addition to the above possibilities, when invoked with a non-existing module sub-modules. Depending on the unittest2_ class that is used to write the tests (see -``openerp.tests.common`` for some helper classes that you can re-use), a database -may be created before the test is run, and the module providing the test will -be installed on that database. +:mod:`openerp.tests.common` for some helper classes that you can re-use), a +database may be created before the test is run, and the module providing the +test will be installed on that database. Because creating a database, installing modules, and then dropping it is expensive, it is possible to interleave the run of the ``fast_suite`` tests @@ -98,3 +98,9 @@ each requested module is installed, its fast_suite tests are run. The database is thus created and dropped (and the modules installed) only once. .. _unittest2: http://pypi.python.org/pypi/unittest2 + +TestCase subclasses +------------------- + +.. automodule:: openerp.tests.common + :members: diff --git a/openerp/tests/common.py b/openerp/tests/common.py index b3ee4ac..26ad1e5 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +""" +The module :mod:`openerp.tests.common` provides a few helper and classes to write +tests. +""" import os import threading import time @@ -92,8 +96,8 @@ class RpcCase(unittest2.TestCase): Subclass of TestCase with a few XML-RPC proxies. """ - def __init__(self, name): - super(RpcCase, self).__init__(name) + def __init__(self, methodName='runTest'): + super(RpcCase, self).__init__(methodName) class A(object): pass -- 1.7.10.4