diff --git a/pyftdi/tests/toolsimport.py b/pyftdi/tests/toolsimport.py index a12241ae..96bdcd3b 100755 --- a/pyftdi/tests/toolsimport.py +++ b/pyftdi/tests/toolsimport.py @@ -13,7 +13,7 @@ from importlib import import_module from os.path import dirname, join as joinpath from sys import modules, path as syspath -from unittest import TestCase, TestSuite, makeSuite, main as ut_main +from unittest import TestCase, TestLoader, TestSuite, main as ut_main class ToolsTestCase(TestCase): @@ -57,7 +57,7 @@ def test_ftdi_urls(self): def suite(): suite_ = TestSuite() - suite_.addTest(makeSuite(ToolsTestCase, 'test')) + suite_.addTest(TestLoader().loadTestsFromModule(modules[__name__])) return suite_ diff --git a/pyftdi/tests/uart.py b/pyftdi/tests/uart.py index 333e3f82..d54f9590 100755 --- a/pyftdi/tests/uart.py +++ b/pyftdi/tests/uart.py @@ -18,7 +18,7 @@ from sys import modules, platform, stdout from time import sleep, time as now from threading import Thread -from unittest import TestCase, TestSuite, skipIf, makeSuite, main as ut_main +from unittest import TestCase, TestLoader, TestSuite, skipIf, main as ut_main from pyftdi import FtdiLogger from pyftdi.ftdi import Ftdi from pyftdi.misc import to_bool @@ -343,8 +343,7 @@ def test(self): def suite(): suite_ = TestSuite() - suite_.addTest(makeSuite(BaudrateTestCase, 'test')) - suite_.addTest(makeSuite(UartTestCase, 'test')) + suite_.addTest(TestLoader().loadTestsFromModule(modules[__name__])) return suite_