3636floatX = pytensor .config .floatX
3737nile = load_nile_test_data ()
3838ALL_SAMPLE_OUTPUTS = MATRIX_NAMES + FILTER_OUTPUT_NAMES + SMOOTHER_OUTPUT_NAMES
39- mock_pymc_sample = pytest .fixture (scope = "session " )(mock_sample_setup_and_teardown )
39+ mock_pymc_sample = pytest .fixture (scope = "module " )(mock_sample_setup_and_teardown )
4040
4141
4242def make_statespace_mod (k_endog , k_states , k_posdef , filter_type , verbose = False , data_info = None ):
@@ -393,7 +393,7 @@ def pymc_mod_time_varying(ss_mod_time_varying, rng):
393393 return m
394394
395395
396- @pytest .fixture (scope = "session " )
396+ @pytest .fixture (scope = "module " )
397397def idata (pymc_mod , rng , mock_pymc_sample ):
398398 with pymc_mod :
399399 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -403,7 +403,7 @@ def idata(pymc_mod, rng, mock_pymc_sample):
403403 return idata
404404
405405
406- @pytest .fixture (scope = "session " )
406+ @pytest .fixture (scope = "module " )
407407def idata_exog (exog_pymc_mod , rng , mock_pymc_sample ):
408408 with exog_pymc_mod :
409409 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -412,7 +412,7 @@ def idata_exog(exog_pymc_mod, rng, mock_pymc_sample):
412412 return idata
413413
414414
415- @pytest .fixture (scope = "session " )
415+ @pytest .fixture (scope = "module " )
416416def idata_exog_mv (exog_pymc_mod_mv , rng , mock_pymc_sample ):
417417 with exog_pymc_mod_mv :
418418 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -421,7 +421,7 @@ def idata_exog_mv(exog_pymc_mod_mv, rng, mock_pymc_sample):
421421 return idata
422422
423423
424- @pytest .fixture (scope = "session " )
424+ @pytest .fixture (scope = "module " )
425425def idata_no_exog (pymc_mod_no_exog , rng , mock_pymc_sample ):
426426 with pymc_mod_no_exog :
427427 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -430,7 +430,7 @@ def idata_no_exog(pymc_mod_no_exog, rng, mock_pymc_sample):
430430 return idata
431431
432432
433- @pytest .fixture (scope = "session " )
433+ @pytest .fixture (scope = "module " )
434434def idata_no_exog_mv (pymc_mod_no_exog_mv , rng , mock_pymc_sample ):
435435 with pymc_mod_no_exog_mv :
436436 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -439,7 +439,7 @@ def idata_no_exog_mv(pymc_mod_no_exog_mv, rng, mock_pymc_sample):
439439 return idata
440440
441441
442- @pytest .fixture (scope = "session " )
442+ @pytest .fixture (scope = "module " )
443443def idata_no_exog_mv_dt (pymc_mod_no_exog_mv_dt , rng , mock_pymc_sample ):
444444 with pymc_mod_no_exog_mv_dt :
445445 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -448,7 +448,7 @@ def idata_no_exog_mv_dt(pymc_mod_no_exog_mv_dt, rng, mock_pymc_sample):
448448 return idata
449449
450450
451- @pytest .fixture (scope = "session " )
451+ @pytest .fixture (scope = "module " )
452452def idata_no_exog_dt (pymc_mod_no_exog_dt , rng , mock_pymc_sample ):
453453 with pymc_mod_no_exog_dt :
454454 idata = pm .sample (draws = 10 , tune = 0 , chains = 1 , random_seed = rng )
@@ -457,7 +457,7 @@ def idata_no_exog_dt(pymc_mod_no_exog_dt, rng, mock_pymc_sample):
457457 return idata
458458
459459
460- @pytest .fixture (scope = "session " )
460+ @pytest .fixture (scope = "module " )
461461def idata_time_varying (pymc_mod_time_varying , rng , mock_pymc_sample ):
462462 """Inference data for time-varying model."""
463463 with pymc_mod_time_varying :
0 commit comments