mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 17:43:38 +02:00
Use find_tests() for library.test_cli as well
This commit is contained in:
parent
5299c936e5
commit
1ff4f01b39
2 changed files with 8 additions and 1 deletions
|
|
@ -10,9 +10,11 @@
|
|||
|
||||
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 ok(x):
|
|||
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 @@ def test_escaped_csv_output(self, mock_stdout):
|
|||
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…
Reference in a new issue