From 05cc8e2b5135b2afa361b5b984bf7d9f76dbe451 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 2 Apr 2021 23:23:09 +0200 Subject: [PATCH] tests: only create selenium_screenshots/ on error Signed-off-by: Jens Langhammer --- tests/e2e/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/utils.py b/tests/e2e/utils.py index b332f6784..3d7c3bca4 100644 --- a/tests/e2e/utils.py +++ b/tests/e2e/utils.py @@ -49,7 +49,6 @@ class SeleniumTestCase(StaticLiveServerTestCase): def setUp(self): super().setUp() self.wait_timeout = 60 - makedirs("selenium_screenshots/", exist_ok=True) self.driver = self._get_driver() self.driver.maximize_window() self.driver.implicitly_wait(30) @@ -85,6 +84,7 @@ class SeleniumTestCase(StaticLiveServerTestCase): def tearDown(self): if "TF_BUILD" in environ: + makedirs("selenium_screenshots/", exist_ok=True) screenshot_file = ( f"selenium_screenshots/{self.__class__.__name__}_{time()}.png" )