@@ -25,7 +25,7 @@ def start_postgres():
2525 murfey_db .commit ()
2626
2727
28- @pytest .fixture ()
28+ @pytest .fixture (scope = "session" )
2929def mock_client_configuration () -> ConfigParser :
3030 """
3131 Returns the client-side configuration file as a pre-loaded ConfigParser object.
@@ -39,7 +39,7 @@ def mock_client_configuration() -> ConfigParser:
3939 return config
4040
4141
42- @pytest .fixture ()
42+ @pytest .fixture (scope = "session" )
4343def mock_ispyb_credentials (tmp_path : Path ):
4444 creds_file = tmp_path / "ispyb_creds.cfg"
4545 ispyb_config = ConfigParser ()
@@ -56,7 +56,7 @@ def mock_ispyb_credentials(tmp_path: Path):
5656 return creds_file
5757
5858
59- @pytest .fixture ()
59+ @pytest .fixture (scope = "session" )
6060def mock_security_configuration (
6161 tmp_path : Path ,
6262 mock_ispyb_credentials : Path ,
@@ -85,7 +85,7 @@ def mock_security_configuration(
8585"""
8686
8787
88- @pytest .fixture
88+ @pytest .fixture ( scope = "session" )
8989def ispyb_db (mock_ispyb_credentials ):
9090 with ispyb .open (mock_ispyb_credentials ) as connection :
9191 yield connection
@@ -105,7 +105,7 @@ def ispyb_session_factory(ispyb_engine):
105105 return scoped_session (sessionmaker (bind = ispyb_engine ))
106106
107107
108- @pytest .fixture ( scope = "function" )
108+ @pytest .fixture
109109def ispyb_session (ispyb_session_factory ):
110110 ispyb_session = ispyb_session_factory ()
111111 yield ispyb_session
0 commit comments