Replace test setuptools command by unittest discover
issue9215 review389851002
This commit is contained in:
@@ -138,6 +138,7 @@ setup(name=name,
|
||||
install_requires=requires,
|
||||
extras_require={
|
||||
'BCrypt': ['bcrypt'],
|
||||
'test': tests_require,
|
||||
'html2text': ['html2text'],
|
||||
},
|
||||
dependency_links=dependency_links,
|
||||
@@ -146,7 +147,4 @@ setup(name=name,
|
||||
[trytond.modules]
|
||||
web_user = trytond.modules.web_user
|
||||
""",
|
||||
test_suite='tests',
|
||||
test_loader='trytond.test_loader:Loader',
|
||||
tests_require=tests_require,
|
||||
)
|
||||
|
||||
@@ -1,9 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
try:
|
||||
from trytond.modules.web_user.tests.test_web_user import suite
|
||||
except ImportError:
|
||||
from .test_web_user import suite
|
||||
|
||||
__all__ = ['suite']
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
# 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 unittest
|
||||
from unittest.mock import ANY, patch
|
||||
|
||||
from trytond.config import config
|
||||
from trytond.modules.party.tests import PartyCheckEraseMixin
|
||||
from trytond.modules.web_user import user as user_module
|
||||
from trytond.pool import Pool
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
from trytond.tests.test_tryton import suite as test_suite
|
||||
from trytond.tests.test_tryton import with_transaction
|
||||
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
|
||||
|
||||
VALIDATION_URL = 'http://www.example.com/validation'
|
||||
RESET_PASSWORD_URL = 'http://www.example.com/reset_password'
|
||||
@@ -200,8 +197,4 @@ class WebUserTestCase(PartyCheckEraseMixin, ModuleTestCase):
|
||||
self.assertEqual(auth_user, user)
|
||||
|
||||
|
||||
def suite():
|
||||
suite = test_suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
WebUserTestCase))
|
||||
return suite
|
||||
del ModuleTestCase
|
||||
@@ -2,8 +2,9 @@
|
||||
envlist = {py37,py38,py39,py310}-{sqlite,postgresql}
|
||||
|
||||
[testenv]
|
||||
extras = test
|
||||
commands =
|
||||
coverage run --include=.*/web_user/* setup.py test
|
||||
coverage run --include=.*/web_user/* -m unittest discover -s tests
|
||||
coverage report --include=.*/web_user/* --omit=*/tests/*
|
||||
deps =
|
||||
coverage
|
||||
|
||||
Reference in New Issue
Block a user