Skip to content
Myr

Add a little documentation regarding kwargs in the `app.test_client()` method

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Matt Wright · committed by Markus Unterwaditzer · parent fed6fd3 · Browse files · 1 file+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−0 removed

  • other:+14 added−0 removed

1 file+14 added−0 removed

modified:flask/app.py+14 added
842 unmodified lines
843 with app.test_client() as c:844 rv = c.get('/?vodka=42')845 assert request.args['vodka'] == '42'846847 Additionally, you may pass optional keyword arguments that will then848 be passed to the application's :attr:`test_client_class` constructor.849 For example::850851 from flask.testing import FlaskClient852853 class CustomClient(FlaskClient):854 def __init__(self, authentication=None, *args, **kwargs):855 FlaskClient.__init__(*args, **kwargs)856 self._authentication = authentication857858 app.test_client_class = CustomClient859 client = app.test_client(authentication='Basic ....')860861 See :class:`~flask.testing.FlaskClient` for more information.862863 .. versionchanged:: 0.4864 added support for `with` block usage for the client.
1039 unmodified lines