@@ -38,26 +38,28 @@ The package provides two fixtures:
38
38
- ` setAuth ` to add authentication data to a request ` kwargs ` and ` cookies ` .
39
39
This method is called automatically for adding credentials to a request.
40
40
41
- - ` ft_client ` for app testing, which depends on the previous fixture, plus the
42
- ` FLASK_TESTER_APP ` environment variables which allow to find the application,
43
- which contains either:
41
+ - ` ft_client ` for app testing, which depends on the previous fixture and
42
+ is configured from two environment variables:
44
43
45
- - The URL of the running application for external tests.
46
- The application is expected to be already running when the test is started.
44
+ - ` FLASK_TESTER_APP ` tells where to find the application:
47
45
48
- - The package (filename without ` .py ` ) to be imported for the application.
49
- - for ` pkg:name ` , ` name ` is the application in ` pkg ` .
50
- - for ` pkg ` only, look for app as ` app ` , ` application ` , ` create_app ` , ` make_app ` .
51
- - in both cases, ` name ` is called if callable and not a Flask application.
46
+ - The URL of the running application for external tests.
47
+ The application is expected to be already running when the test is started.
48
+
49
+ - The package (filename without ` .py ` ) to be imported for the application.
50
+ - for ` pkg:name ` , ` name ` is the application in ` pkg ` .
51
+ - for ` pkg ` only, look for app as ` app ` , ` application ` , ` create_app ` , ` make_app ` .
52
+ - in both cases, ` name ` is called if callable and not a Flask application.
53
+
54
+ If not set, the default is ` app ` , which is to behave like Flask.
52
55
53
- If not set, the default is ` app ` , which is to behave like Flask.
54
-
55
- Moreover:
56
56
- ` FLASK_TESTER_DEFAULT ` default login for authentication, default is _ None_ .
57
57
58
58
The fixture then provides test methods to issue test requests against a Flask application:
59
+
59
60
- ` request ` generic request with ` login ` , ` auth ` , ` status ` end ` content ` extensions.
60
61
- ` get post put patch delete ` methods with the same extensions.
62
+
61
63
Moreover, ` setPass ` , ` setToken ` and ` setCookie ` are forwarded to the internal authenticator.
62
64
63
65
Authenticator environment variables can be set from the pytest Python test file by
0 commit comments