Replace test setuptools command by unittest discover

This commit is contained in:
Jared Esparza 2022-04-27 15:37:56 +02:00
parent 06a4782d1e
commit cf5de9d364
3 changed files with 24 additions and 17 deletions

View File

@ -1,8 +0,0 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
try:
from trytond.modules.analytic_line_state.tests.test_analytic_line_state import suite
except ImportError:
from .test_analytic_line_state import suite
__all__ = ['suite']

View File

@ -445,12 +445,4 @@ class TestCase(CompanyTestMixin, ModuleTestCase):
Move.post(move)
def suite():
suite = test_suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCase))
suite.addTests(doctest.DocFileSuite(
'scenario_account_asset_update_value.rst',
tearDown=doctest_teardown, encoding='utf-8',
checker=doctest_checker,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
return suite
del ModuleTestCase

23
tests/test_scenario.py Normal file
View File

@ -0,0 +1,23 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import doctest
import glob
import os
from trytond.tests.test_tryton import doctest_checker, doctest_teardown
def load_tests(loader, tests, pattern):
cwd = os.getcwd()
try:
os.chdir(os.path.dirname(__file__))
for scenario in glob.glob('*.rst'):
tests.addTests(doctest.DocFileSuite(
scenario, tearDown=doctest_teardown, encoding='utf-8',
checker=doctest_checker,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
finally:
os.chdir(cwd)
return tests