From 91786aa76d15a382c46136cd6763882de1b77ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Sep 2014 08:45:40 +0200 Subject: [PATCH] Use new doctest setup/teardown issue3627 review7401002 --- tests/test_stock.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_stock.py b/tests/test_stock.py index 184544f51c..950b128cca 100644 --- a/tests/test_stock.py +++ b/tests/test_stock.py @@ -8,7 +8,8 @@ from dateutil.relativedelta import relativedelta from functools import partial import trytond.tests.test_tryton from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\ - test_depends, doctest_dropdb + test_depends +from trytond.tests.test_tryton import doctest_setup, doctest_teardown from trytond.transaction import Transaction from trytond.exceptions import UserWarning @@ -668,17 +669,17 @@ def suite(): suite.addTest(test) suite.addTests(unittest.TestLoader().loadTestsFromTestCase(StockTestCase)) suite.addTests(doctest.DocFileSuite('scenario_stock_shipment_out.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) suite.addTests(doctest.DocFileSuite( 'scenario_stock_average_cost_price.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) suite.addTests(doctest.DocFileSuite( 'scenario_stock_inventory.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) suite.addTests(doctest.DocFileSuite('scenario_stock_shipment_internal.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) return suite