From e585e1568662413cf155e5f85440b30596e4eeb0 Mon Sep 17 00:00:00 2001 From: IgorTatarnikov Date: Mon, 30 Oct 2023 13:26:53 +0000 Subject: [PATCH] Refactored test_scene_screenshot to use the tmp_path fixture to fix permission issues for Windows --- tests/test_scene.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_scene.py b/tests/test_scene.py index a6f0f6e3..5bc6ce84 100644 --- a/tests/test_scene.py +++ b/tests/test_scene.py @@ -103,10 +103,11 @@ def test_scene_slice(): @pytest.mark.parametrize( "name, scale", [("test", 2), (None, None), (None, 1), ("test2", None)] ) -def test_scene_screenshot(name, scale): - s = Scene(screenshots_folder="tests/screenshots") +def test_scene_screenshot(name, scale, tmp_path): + d = tmp_path / "screenshots" + d.mkdir() + s = Scene(screenshots_folder=d) s.screenshot(name=name, scale=scale) - shutil.rmtree("tests/screenshots") del s