Skip to content

Commit 08aa472

Browse files
committed
Added Fixture to conftest.py
1 parent 5390b12 commit 08aa472

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

conftest.py

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def pytest_configure(config):
4747
def settings_modification(settings):
4848
settings.CELERY_ALWAYS_EAGER = True
4949

50+
5051
@pytest.fixture
5152
def api_client():
5253
return APIClient()
54+
55+
56+
@pytest.fixture(scope="class")
57+
def url_scheme(request):
58+
request.cls.url_scheme = request.config.option.url_scheme

readthedocs/rtd_tests/tests/test_core_tags.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@
1010
from readthedocs.projects.models import Project
1111

1212

13+
@pytest.mark.usefixtures("url_scheme")
1314
@override_settings(USE_SUBDOMAIN=False, PRODUCTION_DOMAIN='readthedocs.org')
1415
class CoreTagsTests(TestCase):
1516
fixtures = ['eric', 'test_data']
1617

17-
@pytest.fixture(autouse=True)
18-
def url_scheme(self, request):
19-
self.url_scheme = request.config.option.url_scheme
20-
2118
def setUp(self):
2219
url_base = '{scheme}://{domain}/docs/pip{{version}}'.format(
2320
scheme=self.url_scheme,

0 commit comments

Comments
 (0)