Skip to content

Commit 6ad0ae5

Browse files
authored
Merge pull request #84 from nicoddemus/fix-warnings
Fix pytest warnings
2 parents 121a24f + 1d4e720 commit 6ad0ae5

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Changelog
77
Next Release
88
------------
99

10+
- ``pytest-flask`` now requires ``pytest>=3.6`` (`#84`_).
11+
1012
- Add new ``--live-server-port`` option to select the port the live server will use (`#82`_).
1113
Thanks `@RazerM`_ for the PR.
1214

@@ -16,10 +18,13 @@ Next Release
1618
``--no-live-server-clean-stop`` in the command-line (`#49`_).
1719
Thanks `@jadkik`_ for the PR.
1820

21+
- Internal fixes silence pytest warnings, more visible now with ``pytest-3.8.0`` (`#84`_).
22+
1923
.. _@jadkik: https://github.com/jadkik
2024
.. _@RazerM: https://github.com/RazerM
2125
.. _#49: https://github.com/pytest-dev/pytest-flask/issues/49
2226
.. _#82: https://github.com/pytest-dev/pytest-flask/pull/82
27+
.. _#84: https://github.com/pytest-dev/pytest-flask/pull/84
2328

2429

2530
0.11.0 (compared to 0.10.0)

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)

pytest_flask/plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ def test_something(app):
108108
return
109109

110110
app = getfixturevalue(request, 'app')
111-
options = request.keywords.get('options')
112-
if options is not None:
111+
for options in request.node.iter_markers('options'):
113112
for key, value in options.kwargs.items():
114113
monkeypatch.setitem(app.config, key.upper(), value)
115114

requirements/main.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
pytest>=3.6
12
Flask
2-
Werkzeug>=0.7
3+
Werkzeug>=0.7

0 commit comments

Comments
 (0)