From 8569ea044b20aad77a5ae5643b493b77e42a10d8 Mon Sep 17 00:00:00 2001 From: Jonathan Haigh Date: Tue, 14 Jan 2025 16:28:26 +0000 Subject: [PATCH] fix pystack test --- .../mantidqt/dialogs/errorreports/test/test_run_pystack.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qt/python/mantidqt/mantidqt/dialogs/errorreports/test/test_run_pystack.py b/qt/python/mantidqt/mantidqt/dialogs/errorreports/test/test_run_pystack.py index 01cb6b8ac676..c5463801d683 100644 --- a/qt/python/mantidqt/mantidqt/dialogs/errorreports/test/test_run_pystack.py +++ b/qt/python/mantidqt/mantidqt/dialogs/errorreports/test/test_run_pystack.py @@ -5,6 +5,7 @@ # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + +from pathlib import Path from tempfile import NamedTemporaryFile, TemporaryDirectory from time import sleep from unittest import TestCase @@ -49,7 +50,7 @@ def test_get_most_recent_core_dump_file_gets_the_latest_file(self, mock_check_wo for name in file_names: open(f"{tmp_dir}/{name}", "a").close() sleep(0.1) - latest_file = _get_most_recent_core_dump_file(tmp_dir) + latest_file = _get_most_recent_core_dump_file(Path(tmp_dir)) self.assertEqual(latest_file.name, file_names[-1]) @patch(f"{MODULE_PATH}.CORE_DUMP_RECENCY_LIMIT", 0.5) @@ -57,8 +58,8 @@ def test_get_most_recent_core_dump_file_returns_none_if_there_are_no_new_files(s with TemporaryDirectory() as tmp_dir: open(f"{tmp_dir}/test", "a").close() sleep(0.6) - self.assertIsNone(_get_most_recent_core_dump_file(tmp_dir)) + self.assertIsNone(_get_most_recent_core_dump_file(Path(tmp_dir))) def test_get_most_recent_core_dump_file_returns_none_if_the_dir_is_empty(self): with TemporaryDirectory() as tmp_dir: - self.assertIsNone(_get_most_recent_core_dump_file(tmp_dir)) + self.assertIsNone(_get_most_recent_core_dump_file(Path(tmp_dir)))