From 62fe955a9f7335d9f3edb0711306fbe0957ec719 Mon Sep 17 00:00:00 2001 From: Helena Nandi Formentin Date: Wed, 24 Jun 2020 14:33:01 +0200 Subject: [PATCH] Print prettier status.json and jobs.json --- python/job_runner/reporting/file.py | 2 +- python/tests/res/job_queue/test_equinor_jobmanager.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/job_runner/reporting/file.py b/python/job_runner/reporting/file.py index b55333a79a..50ba326cdf 100644 --- a/python/job_runner/reporting/file.py +++ b/python/job_runner/reporting/file.py @@ -195,4 +195,4 @@ def _dump_ok_file(self, sync_disc_timeout): def _dump_status_json(self): with open(self.STATUS_json, "w") as fp: - json.dump(self.status_dict, fp) + json.dump(self.status_dict, fp, indent=1) diff --git a/python/tests/res/job_queue/test_equinor_jobmanager.py b/python/tests/res/job_queue/test_equinor_jobmanager.py index 1a791047d2..c35ec2649e 100644 --- a/python/tests/res/job_queue/test_equinor_jobmanager.py +++ b/python/tests/res/job_queue/test_equinor_jobmanager.py @@ -55,7 +55,7 @@ def create_jobs_py(jobList): with open(jobs_file, "w") as f: f.write("jobList = ") - f.write(json.dumps(jobList)) + f.write(json.dumps(jobList, indent=1)) f.write("\n") return jobs_file @@ -66,7 +66,7 @@ def create_jobs_json(jobList, umask="0000"): jobs_file = os.path.join(os.getcwd(), "jobs.json") with open(jobs_file, "w") as f: - f.write(json.dumps(data)) + f.write(json.dumps(data), indent=1) @pytest.mark.equinor_test