fix(run-tests): don't try to access frappe.flags before frappe.init()
Broke in #24432 Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
e35d774eda
commit
60c1812cc2
2 changed files with 7 additions and 3 deletions
|
|
@ -772,9 +772,6 @@ def run_tests(
|
|||
click.secho(f"bench --site {site} set-config allow_tests true", fg="green")
|
||||
return
|
||||
|
||||
frappe.flags.skip_before_tests = skip_before_tests
|
||||
frappe.flags.skip_test_records = skip_test_records
|
||||
|
||||
ret = frappe.test_runner.main(
|
||||
site,
|
||||
app,
|
||||
|
|
@ -789,6 +786,8 @@ def run_tests(
|
|||
doctype_list_path=doctype_list_path,
|
||||
failfast=failfast,
|
||||
case=case,
|
||||
skip_test_records=skip_test_records,
|
||||
skip_before_tests=skip_before_tests,
|
||||
)
|
||||
|
||||
if len(ret.failures) == 0 and len(ret.errors) == 0:
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ def main(
|
|||
doctype_list_path=None,
|
||||
failfast=False,
|
||||
case=None,
|
||||
skip_test_records=False,
|
||||
skip_before_tests=False,
|
||||
):
|
||||
global unittest_runner
|
||||
|
||||
|
|
@ -58,6 +60,9 @@ def main(
|
|||
if not frappe.db:
|
||||
frappe.connect()
|
||||
|
||||
frappe.flags.skip_before_tests = skip_before_tests
|
||||
frappe.flags.skip_test_records = skip_test_records
|
||||
|
||||
if doctype_list_path:
|
||||
app, doctype_list_path = doctype_list_path.split(os.path.sep, 1)
|
||||
with open(frappe.get_app_path(app, doctype_list_path)) as f:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue