1414from aiida .plugins import CalculationFactory
1515import pytest
1616
17- pytest_plugins = ["aiida.manage.tests .pytest_fixtures" ]
17+ pytest_plugins = ["aiida.tools .pytest_fixtures" ]
1818
1919
2020@pytest .fixture (scope = "function" , autouse = True )
2121def clear_database_auto (aiida_profile_clean ):
2222 """Automatically clear database in between tests."""
2323
2424
25+ @pytest .fixture (scope = "session" , autouse = True )
26+ def aiida_profile (aiida_config , aiida_profile_factory ):
27+ """
28+ Session-scoped fixture to create an AiiDA profile.
29+
30+ Yields
31+ ------
32+ `Profile`
33+ A default profile instance.
34+ """
35+ with aiida_profile_factory (aiida_config , broker_backend = "core.rabbitmq" ) as profile :
36+ yield profile
37+
38+
2539@pytest .fixture (scope = "session" )
2640def filepath_tests ():
2741 """
@@ -82,7 +96,7 @@ def fixture_localhost(aiida_localhost):
8296
8397
8498@pytest .fixture (scope = "function" )
85- def janus_code (aiida_local_code_factory ):
99+ def janus_code (aiida_code_installed ):
86100 """
87101 Fixture to get the janus code.
88102
@@ -97,7 +111,12 @@ def janus_code(aiida_local_code_factory):
97111 The janus code instance.
98112 """
99113 janus_path = shutil .which ("janus" ) or os .environ .get ("JANUS_PATH" )
100- return aiida_local_code_factory (executable = janus_path , entry_point = "mlip.sp" )
114+
115+ return aiida_code_installed (
116+ label = "janus" ,
117+ default_calc_job_plugin = "mlip.sp" ,
118+ filepath_executable = janus_path ,
119+ )
101120
102121
103122@pytest .fixture
0 commit comments