From dcd34d784e0f749fe67f2bddcb74bddbf2fa5be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Ri=C3=9Fe?= Date: Mon, 26 Feb 2024 14:05:48 +0100 Subject: [PATCH] WIP --- conftest.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index a1aa82e37..20d7a402b 100644 --- a/conftest.py +++ b/conftest.py @@ -90,7 +90,8 @@ def generate_initial_config(): examples = DataFiles(data_fs=constants.DATA_FS, server_config_fs=constants.SERVER_CONFIG_FS) examples.create_server_config(detailed_information=True) - examples.create_data() + if constants.DATA_FS.isempty("/"): + examples.create_data() if not constants.SERVER_CONFIG_FS.exists(constants.MSCOLAB_CONFIG_FILE): config_string = f''' @@ -220,9 +221,15 @@ def reset_config(): """Reset the configuration directory used in the tests (tests.constants.ROOT_FS) after every test """ # Ideally this would just be constants.ROOT_FS.removetree("/"), but SQLAlchemy complains if the SQLite file is deleted. + # Also, on Windows there are issues with files in msui/testdata being held open in another process, so those are + # excluded as well. This shouldn't be a problem since they are meant to be static anyway. for e in constants.ROOT_FS.walk.files(exclude=["mscolab.db"]): + if fs.path.isbase("/msui/testdata", e): + continue constants.ROOT_FS.remove(e) for e in constants.ROOT_FS.walk.dirs(search="depth"): + if e == "/msui" or fs.path.isbase("/msui/testdata", e): + continue constants.ROOT_FS.removedir(e) generate_initial_config()