From 73ea3adbd3c70d7313b63e6b830981f98d728a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 16 Apr 2022 18:30:17 +0200 Subject: [PATCH] Replace test setuptools command by unittest discover issue9215 review389851002 --- setup.py | 2 -- tests/__init__.py | 7 ------- tests/{test_google_maps.py => test_module.py} | 8 +------- tox.ini | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) rename tests/{test_google_maps.py => test_module.py} (86%) diff --git a/setup.py b/setup.py index 883d761f14..205689b652 100755 --- a/setup.py +++ b/setup.py @@ -142,6 +142,4 @@ setup(name=name, [trytond.modules] google_maps = trytond.modules.google_maps """, - test_suite='tests', - test_loader='trytond.test_loader:Loader', ) diff --git a/tests/__init__.py b/tests/__init__.py index da47257c50..4effdfa4a2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -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.google_maps.tests.test_google_maps import suite -except ImportError: - from .test_google_maps import suite - -__all__ = ['suite'] diff --git a/tests/test_google_maps.py b/tests/test_module.py similarity index 86% rename from tests/test_google_maps.py rename to tests/test_module.py index d010104833..43a5dd8511 100644 --- a/tests/test_google_maps.py +++ b/tests/test_module.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # 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 -import trytond.tests.test_tryton from trytond.pool import Pool from trytond.tests.test_tryton import ModuleTestCase, with_transaction @@ -45,8 +43,4 @@ class GoogleMapsTestCase(ModuleTestCase): 'q=D%C3%A9p%C3%B4t%20Street%2018503%20Scranton') -def suite(): - suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - GoogleMapsTestCase)) - return suite +del ModuleTestCase diff --git a/tox.ini b/tox.ini index 888f072439..0b2550d613 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = {py37,py38,py39,py310}-{sqlite,postgresql} [testenv] commands = - coverage run --include=.*/google_maps/* setup.py test + coverage run --include=.*/google_maps/* -m unittest discover -s tests coverage report --include=.*/google_maps/* --omit=*/tests/* deps = coverage