From f8340436a1b0a4f5d74aa8cbb7ec7401bfe3d66b Mon Sep 17 00:00:00 2001 From: Panu Lahtinen Date: Fri, 15 Nov 2024 10:44:34 +0200 Subject: [PATCH] Put output dir to tmp_path --- trollflow2/tests/test_trollflow2.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trollflow2/tests/test_trollflow2.py b/trollflow2/tests/test_trollflow2.py index 23cc8cf..9f362ef 100644 --- a/trollflow2/tests/test_trollflow2.py +++ b/trollflow2/tests/test_trollflow2.py @@ -293,6 +293,11 @@ class TestSaveDatasets(TestCase): """Test case for saving datasets.""" + @pytest.fixture(autouse=True) + def inject_fixtures(self, tmp_path): + """Inject pytest fixtures.""" + self._tmp_path = tmp_path + def test_prepared_filename(self): """Test the `prepared_filename` context.""" from trollflow2.plugins import prepared_filename @@ -580,6 +585,7 @@ def test_pop_unknown_args(self): from trollflow2.plugins import save_datasets job = _create_job_for_save_datasets() + output_dir = self._tmp_path / "örülök, hogy megismerhetem" product_list = { "fname_pattern": "name.tif", "use_tmp_file": True, @@ -596,7 +602,7 @@ def test_pop_unknown_args(self): "PhysicUnit": "no", "PhysicValue": "yes", "SatelliteNameID": 0, - "output_dir": "örülök, hogy megismerhetem", + "output_dir": str(output_dir), "fname_pattern": "viszontlátásra", "dispatch": {}, "use_tmp_file": False,