Replace test setuptools command by unittest discover

issue9215
review389851002
This commit is contained in:
Cédric Krier committed 2022-04-16 18:30:20 +02:00
1 parent d5f7c83342
commit e0b1ac3daf
4 files changed
+2 -29

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Use unittest discover
* Support notification message
* Add option to define logging output location
* Remove TreeViewControl
-1
View File
@@ -160,6 +160,5 @@ dist = setup(name=name,
},
dependency_links=dependency_links,
zip_safe=False,
test_suite='tryton.tests',
**args
)
+1 -1
View File
@@ -3,7 +3,7 @@ envlist = py37,py38,py39,py310
[testenv]
commands =
coverage run setup.py test
coverage run -m unittest discover -s tryton.tests
coverage report --include=./tryton/* --omit=*/tests/*
deps =
coverage
-27
View File
@@ -1,29 +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.
import os
import sys
import unittest
def test_suite():
suite = unittest.TestSuite()
loader = unittest.TestLoader()
for filename in os.listdir(os.path.dirname(__file__)):
if filename.startswith("test") and filename.endswith(".py"):
modname = "tryton.tests." + filename[:-3]
__import__(modname)
module = sys.modules[modname]
suite.addTests(loader.loadTestsFromModule(module))
return suite
def main():
suite = test_suite()
runner = unittest.TextTestRunner()
return runner.run(suite)
if __name__ == '__main__':
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
sys.exit(not main().wasSuccessful())