mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use find_tests() for library.test_cli as well
This commit is contained in:
parent
5299c936e5
commit
1ff4f01b39
@ -10,9 +10,11 @@ from setup import Command
|
||||
|
||||
TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build misc library'.split())
|
||||
|
||||
|
||||
def find_tests(which_tests=None):
|
||||
ans = []
|
||||
a = ans.append
|
||||
|
||||
def ok(x):
|
||||
return not which_tests or x in which_tests
|
||||
|
||||
@ -65,7 +67,8 @@ def find_tests(which_tests=None):
|
||||
from calibre.utils.shared_file import find_tests
|
||||
a(find_tests())
|
||||
if ok('library'):
|
||||
a(unittest.TestLoader().discover('src/calibre/library'))
|
||||
from calibre.library.test_cli import find_tests
|
||||
a(find_tests())
|
||||
|
||||
tests = unittest.TestSuite(ans)
|
||||
return tests
|
||||
|
@ -98,3 +98,7 @@ class PrintCheckLibraryResultsTest(unittest.TestCase):
|
||||
result = mock_stdout.getvalue().split('\n')
|
||||
parsed_result = [l for l in csv.reader(result) if l]
|
||||
self.assertEqual(parsed_result, [[self.check_human_name, data[0][0], data[0][1]]])
|
||||
|
||||
|
||||
def find_tests():
|
||||
return unittest.defaultTestLoader.loadTestsFromTestCase(PrintCheckLibraryResultsTest)
|
||||
|
Loading…
x
Reference in New Issue
Block a user