Skip to content

Commit 0b6be5a

Browse files
committed
Remove warning about fixture being called directly
1 parent 121a24f commit 0b6be5a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pytest_flask/fixtures.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,25 @@ def mimetype(request):
177177
return request.param
178178

179179

180+
def _make_accept_header(mimetype):
181+
return [('Accept', mimetype)]
182+
183+
180184
@pytest.fixture
181185
def accept_mimetype(mimetype):
182-
return [('Accept', mimetype)]
186+
return _make_accept_header(mimetype)
183187

184188

185189
@pytest.fixture
186190
def accept_json(request):
187-
return accept_mimetype('application/json')
191+
return _make_accept_header('application/json')
188192

189193

190194
@pytest.fixture
191195
def accept_jsonp():
192-
return accept_mimetype('application/json-p')
196+
return _make_accept_header('application/json-p')
193197

194198

195199
@pytest.fixture(params=['*', '*/*'])
196200
def accept_any(request):
197-
return accept_mimetype(request.param)
201+
return _make_accept_header(request.param)

0 commit comments

Comments
 (0)