summaryrefslogtreecommitdiff
path: root/addons/analytic_user_function/analytic_user_function.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2015-06-23 13:14:07 +0200
committerXavier Morel <xmo@odoo.com>2015-06-23 16:38:14 +0200
commit11ba4689b1d9d602cc27270239fd96f2af840106 (patch)
treef5d4938616f1fcc4f5afc9c2f4ac44751971306e /addons/analytic_user_function/analytic_user_function.py
parent386f76eb46deee167234edfb1f9b1d3bb6b86e5f (diff)
[IMP] running speed of some tests & new testcase type
Some tests (e.g. mail) have expensive and significant DB setup for a number of small and cheap tests. Using a TransactionCase, the DB setup far dominates the tests themselves, by up to 10x (mail unit tests take ~130s on my machine, the tests themselves take ~15s). The SavepointCase introduced here is an hybrid of SingleTransactionCase and TransactionCase: it uses a single transaction for all tests in a class, but each test case is isolated by a rollbacked savepoint. This allows a common DB setup (via setUpClass) while keeping independent tests. TransactionCase should remain the primary test case superclass, but SavepointCase can be a fair optimisation when setup costs far dominate.
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
0 files changed, 0 insertions, 0 deletions