Skip to content

Commit 2469824

Browse files
author
Alzbeta Pokorna
committed
anonymous client
1 parent 7b469ee commit 2469824

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

oarepo_model_builder_tests/templates/conftest.py.jinja2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ def role(app, db):
119119
db.session.commit()
120120
return role
121121

122+
@pytest.fixture(scope="function")
123+
def anonymous_client(app):
124+
"""Test client for the base application fixture.
125+
126+
Scope: function
127+
128+
If you need the database and search indexes initialized, simply use the
129+
Pytest-Flask fixture ``client`` instead. This fixture is mainly useful if
130+
you need a test client without needing to initialize both the database and
131+
search indexes.
132+
"""
133+
with app.test_client() as client:
134+
yield client
122135

123136
@pytest.fixture()
124137
def client_with_credentials(db, client, user, role, sample_metadata_list):

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = oarepo-model-builder-tests
3-
version = 4.0.9
3+
version = 4.0.10
44
description =
55
authors = Ronald Krist <[email protected]>
66
readme = README.md

0 commit comments

Comments
 (0)