From a9d7eda58db27026787cdc412393aaeb14e93431 Mon Sep 17 00:00:00 2001 From: avdata99 Date: Wed, 15 Jan 2025 11:28:11 -0300 Subject: [PATCH] fixture --- ckanext/saml2auth/tests/fixtures.py | 7 +++++++ conftest.py | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 ckanext/saml2auth/tests/fixtures.py diff --git a/ckanext/saml2auth/tests/fixtures.py b/ckanext/saml2auth/tests/fixtures.py new file mode 100644 index 0000000..72af274 --- /dev/null +++ b/ckanext/saml2auth/tests/fixtures.py @@ -0,0 +1,7 @@ +import pytest + + +@pytest.fixture(autouse=True) +def load_standard_plugins(with_plugins): + """ Use 'with_plugins' fixture in ALL tests """ + pass diff --git a/conftest.py b/conftest.py index 2607f6c..634524b 100644 --- a/conftest.py +++ b/conftest.py @@ -20,9 +20,13 @@ from ckan.plugins import toolkit +pytest_plugins = [ + 'ckanext.saml2auth.tests.fixtures', +] + if toolkit.check_ckan_version(max_version='2.10.99'): - pytest_plugins = [ - u'ckan.tests.pytest_ckan.ckan_setup', - u'ckan.tests.pytest_ckan.fixtures', + pytest_plugins += [ + 'ckan.tests.pytest_ckan.ckan_setup', + 'ckan.tests.pytest_ckan.fixtures', ]