Skip to content

Commit

Permalink
Merge pull request #31 from vpipkt/feat/duration-json-pretty
Browse files Browse the repository at this point in the history
Pretty print test duration artifact
  • Loading branch information
jerry-git committed Nov 9, 2021
2 parents f1cb999 + 2504f0a commit 8b5a89e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pytest_split/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def pytest_sessionfinish(self) -> None:
self.cached_durations[k] = v

with open(self.config.option.durations_path, "w") as f:
json.dump(self.cached_durations, f)
json.dump(self.cached_durations, f, sort_keys=True, indent=4)

message = self.writer.markup(
"\n\n[pytest-split] Stored test durations in {}".format(self.config.option.durations_path)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_it_stores(self, example_suite, durations_path):

assert list(durations.keys()) == [
"test_it_stores.py::test_1",
"test_it_stores.py::test_10",
"test_it_stores.py::test_2",
"test_it_stores.py::test_3",
"test_it_stores.py::test_4",
Expand All @@ -38,7 +39,6 @@ def test_it_stores(self, example_suite, durations_path):
"test_it_stores.py::test_7",
"test_it_stores.py::test_8",
"test_it_stores.py::test_9",
"test_it_stores.py::test_10",
]

for duration in durations.values():
Expand Down

0 comments on commit 8b5a89e

Please sign in to comment.