fix test
This commit is contained in:
parent
11aca930e8
commit
be98dc03d3
1 changed files with 11 additions and 0 deletions
|
|
@ -97,9 +97,20 @@ def _run_unittest(module, verbose=False, tests=()):
|
|||
def _add_test(path, filename, verbose, test_suite=None):
|
||||
import os, imp
|
||||
|
||||
if os.path.sep.join("doctype", "doctype", "boilerplate") in path:
|
||||
# in /doctype/doctype/boilerplate/
|
||||
return
|
||||
|
||||
if not test_suite:
|
||||
test_suite = unittest.TestSuite()
|
||||
|
||||
if os.path.basename(os.path.dirname(path))=="doctype":
|
||||
txt_file = os.path.join(path, filename[5:].replace(".py", ".json"))
|
||||
with open(txt_file, 'r') as f:
|
||||
doc = json.loads(f.read())
|
||||
doctype = doc["name"]
|
||||
make_test_records(doctype, verbose)
|
||||
|
||||
module = imp.load_source(filename[:-3], os.path.join(path, filename))
|
||||
test_suite.addTest(unittest.TestLoader().loadTestsFromModule(module))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue