diff --git a/pymc3/tests/test_shape_handling.py b/pymc3/tests/test_shape_handling.py index 3a1cd61375..490c09ada8 100644 --- a/pymc3/tests/test_shape_handling.py +++ b/pymc3/tests/test_shape_handling.py @@ -41,22 +41,22 @@ test_to_shapes = [None, tuple(), (10, 5, 4), (10, 1, 1, 5, 1)] -@pytest.fixture(scope="module", params=test_sizes, ids=str) +@pytest.fixture(params=test_sizes, ids=str) def fixture_sizes(request): return request.param -@pytest.fixture(scope="module", params=test_shapes, ids=str) +@pytest.fixture(params=test_shapes, ids=str) def fixture_shapes(request): return request.param -@pytest.fixture(scope="module", params=[False, True], ids=str) +@pytest.fixture(params=[False, True], ids=str) def fixture_exception_handling(request): return request.param -@pytest.fixture(scope="module") +@pytest.fixture() def samples_to_broadcast(fixture_sizes, fixture_shapes): samples = [np.empty(s) for s in fixture_shapes] try: @@ -68,7 +68,7 @@ def samples_to_broadcast(fixture_sizes, fixture_shapes): return fixture_sizes, samples, broadcast_shape -@pytest.fixture(scope="module", params=test_to_shapes, ids=str) +@pytest.fixture(params=test_to_shapes, ids=str) def samples_to_broadcast_to(request, samples_to_broadcast): to_shape = request.param size, samples, broadcast_shape = samples_to_broadcast @@ -82,7 +82,7 @@ def samples_to_broadcast_to(request, samples_to_broadcast): return to_shape, size, samples, broadcast_shape -@pytest.fixture(scope="module") +@pytest.fixture def fixture_model(): with pm.Model() as model: n = 5 diff --git a/pymc3/tests/test_variational_inference.py b/pymc3/tests/test_variational_inference.py index 7d40d9931e..1becfd24fe 100644 --- a/pymc3/tests/test_variational_inference.py +++ b/pymc3/tests/test_variational_inference.py @@ -151,6 +151,7 @@ def three_var_approx(three_var_model, three_var_groups): def three_var_approx_single_group_mf(three_var_model): return MeanField(model=three_var_model) + @pytest.fixture( params = [ ('ndarray', None), @@ -566,7 +567,7 @@ def use_minibatch(request): return request.param -@pytest.fixture('module') +@pytest.fixture def simple_model_data(use_minibatch): n = 1000 sigma0 = 2. @@ -590,7 +591,7 @@ def simple_model_data(use_minibatch): ) -@pytest.fixture(scope='module') +@pytest.fixture def simple_model(simple_model_data): with pm.Model() as model: mu_ = pm.Normal(