From 0ef5f752af75cb52faa8d5a3b5f2b68bd754e4cf Mon Sep 17 00:00:00 2001 From: Jason T Brown Date: Wed, 11 Aug 2021 16:50:37 +0000 Subject: [PATCH 1/3] Pretty print test duration artifact --- src/pytest_split/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_split/plugin.py b/src/pytest_split/plugin.py index fca0750..f65b9a6 100644 --- a/src/pytest_split/plugin.py +++ b/src/pytest_split/plugin.py @@ -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) From 842ac8ca9951381f2cf29a3079ce585cbfece8ca Mon Sep 17 00:00:00 2001 From: Jason T Brown Date: Wed, 11 Aug 2021 17:07:09 +0000 Subject: [PATCH 2/3] key order in test_it_stores --- tests/test_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 82807cd..12ae171 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -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", @@ -38,8 +39,7 @@ 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", - ] + ], durations.keys() for duration in durations.values(): assert isinstance(duration, float) From a6b63805806381cc26afa641d442e47612affd2d Mon Sep 17 00:00:00 2001 From: Jason T Brown Date: Fri, 15 Oct 2021 17:11:01 +0000 Subject: [PATCH 3/3] Remove additional message param in test assert --- tests/test_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 12ae171..de2a923 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -39,7 +39,7 @@ 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", - ], durations.keys() + ] for duration in durations.values(): assert isinstance(duration, float)