From 29afd852bab5990b22c99182d7c9cd62421e6346 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Jul 2022 19:01:14 +0530 Subject: [PATCH] Remove code to select tests This can be done with ./setup.py test --test-name=whatever --- src/calibre/db/tests/reading.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/calibre/db/tests/reading.py b/src/calibre/db/tests/reading.py index beb4236fe6..590c1c2927 100644 --- a/src/calibre/db/tests/reading.py +++ b/src/calibre/db/tests/reading.py @@ -755,6 +755,7 @@ class ReadingTest(BaseTest): db.create_custom_column('mult', 'CC1', 'composite', True, display={'composite_template': 'b,a,c'}) db = self.init_legacy(self.library_path) + class GetGuiAns(): current_db = None get_gui_ans = GetGuiAns() @@ -816,26 +817,3 @@ class ReadingTest(BaseTest): finally: get_gui.ans = None # }}} - - -import unittest, importlib, sys -from calibre.utils.run_tests import run_tests, filter_tests_by_name - - -if __name__ == '__main__': - try: - import init_calibre # noqa - except ImportError: - pass - tests = sys.argv[1:] - sys.argv = sys.argv[0:1] - - def find_tests(): - m = importlib.import_module('calibre.db.tests.reading') - suite = unittest.TestSuite([unittest.defaultTestLoader.loadTestsFromModule(m)]) - if tests: - return filter_tests_by_name(suite, *tests) - else: - return suite - - run_tests(find_tests) \ No newline at end of file