fix(test_runner): Load file if exists
This commit is contained in:
parent
5e8a56b444
commit
44028ce23a
1 changed files with 6 additions and 5 deletions
|
|
@ -250,10 +250,11 @@ def _add_test(app, path, filename, verbose, test_suite=None, ui_tests=False):
|
|||
|
||||
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)
|
||||
if os.path.exists(txt_file):
|
||||
with open(txt_file, 'r') as f:
|
||||
doc = json.loads(f.read())
|
||||
doctype = doc["name"]
|
||||
make_test_records(doctype, verbose)
|
||||
|
||||
test_suite.addTest(unittest.TestLoader().loadTestsFromModule(module))
|
||||
|
||||
|
|
@ -417,4 +418,4 @@ def get_test_record_log():
|
|||
else:
|
||||
frappe.flags.test_record_log = []
|
||||
|
||||
return frappe.flags.test_record_log
|
||||
return frappe.flags.test_record_log
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue