diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2024-10-10 14:33:24 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2024-10-10 14:37:07 +0200 |
commit | 5dfbdde09d25c3f29df47ac9ce2f19b5c3d096d1 (patch) | |
tree | be07a559e15b75e9145c9df31bbeedc6bd0dfec0 /xtesting/core | |
parent | 4ed41c8b7767ab6b87081b1837f58885828262ac (diff) |
Clean res dir before running pyteststable/2024.1
Pytest fails when rerun
Change-Id: I957955300b2ef65bd1c5fdb28869921bca34ac57
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit ed61c53f85c9dcb5a5a3029c84d50100028d5e63)
Diffstat (limited to 'xtesting/core')
-rw-r--r-- | xtesting/core/pytest.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xtesting/core/pytest.py b/xtesting/core/pytest.py index 84d8ac58..a6735f17 100644 --- a/xtesting/core/pytest.py +++ b/xtesting/core/pytest.py @@ -12,6 +12,8 @@ import contextlib import io import logging +import os +import shutil import time import pytest @@ -69,6 +71,8 @@ class Pytest(testcase.TestCase): status = self.EX_RUN_ERROR self.start_time = time.time() try: + if os.path.exists(os.path.join(self.dir_results, self.case_name)): + shutil.rmtree(os.path.join(self.dir_results, self.case_name)) pydir = kwargs.pop('dir') options = kwargs.pop('options', {}) options['html'] = f'{self.res_dir}/results.html' |