1414from tests import murfey_db_engine , murfey_db_url
1515
1616
17+ @pytest .fixture (scope = "session" )
18+ def session_tmp_path (tmp_path_factory ) -> Path :
19+ """
20+ Creates a temporary path that persists for the entire test session
21+ """
22+ return tmp_path_factory .mktemp ("session_tmp" )
23+
24+
1725@pytest .fixture
1826def start_postgres ():
1927 clear (murfey_db_url )
@@ -40,8 +48,8 @@ def mock_client_configuration() -> ConfigParser:
4048
4149
4250@pytest .fixture (scope = "session" )
43- def mock_ispyb_credentials (tmp_path : Path ):
44- creds_file = tmp_path / "ispyb_creds.cfg"
51+ def mock_ispyb_credentials (session_tmp_path : Path ) -> Path :
52+ creds_file = session_tmp_path / "ispyb_creds.cfg"
4553 ispyb_config = ConfigParser ()
4654 # Use values from the GitHub workflow ISPyB config file
4755 ispyb_config ["ispyb_sqlalchemy" ] = {
@@ -58,10 +66,10 @@ def mock_ispyb_credentials(tmp_path: Path):
5866
5967@pytest .fixture (scope = "session" )
6068def mock_security_configuration (
61- tmp_path : Path ,
69+ session_tmp_path : Path ,
6270 mock_ispyb_credentials : Path ,
63- ):
64- config_file = tmp_path / "security_config.yaml"
71+ ) -> Path :
72+ config_file = session_tmp_path / "security_config.yaml"
6573 security_config = {
6674 "murfey_db_credentials" : "/path/to/murfey_db_credentials" ,
6775 "crypto_key" : "crypto_key" ,
0 commit comments