+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=919539527
rootdir: /home/tkloczko/rpmbuild/BUILD/flask-2.0.2, configfile: setup.cfg, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, xprocess-0.18.1, black-0.3.12, asyncio-0.15.1, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1, twisted-1.13.3, aiohttp-0.3.0, localserver-0.5.0, anyio-3.3.1, trio-0.7.0, cases-3.6.4, yagot-0.5.0, Faker-8.14.1
collected 479 items
tests/test_signals.py ....... [ 1%]
tests/test_basic.py .........F...........FF.......F......................F................F....................F......F.............F..F.............. [ 28%]
tests/test_subclassing.py . [ 28%]
tests/test_templating.py ...F.....F.F...............F... [ 35%]
tests/test_session_interface.py . [ 35%]
tests/test_instance_config.py X...X..X... [ 37%]
tests/test_testing.py ..............FF..F..F.... [ 43%]
tests/test_json_tag.py .............. [ 46%]
tests/test_cli.py ....................................................... [ 57%]
tests/test_reqctx.py .............. [ 60%]
tests/test_regression.py . [ 60%]
tests/test_user_error_handler.py ......... [ 62%]
tests/test_appctx.py ..F........... [ 65%]
tests/test_converters.py .. [ 65%]
tests/test_views.py ............ [ 68%]
tests/test_blueprints.py ......................................................... [ 80%]
tests/test_async.py ...s..... [ 82%]
tests/test_logging.py ...... [ 83%]
tests/test_config.py ................ [ 86%]
tests/test_helpers.py .....FFFFFFFF................. [ 93%]
tests/test_json.py ..............F................F. [100%]
================================================================================= FAILURES =================================================================================
___________________________________________________________________________ test_get_method_on_g ___________________________________________________________________________
app_ctx = <flask.ctx.AppContext object at 0x7f182699e7f0>
def test_get_method_on_g(app_ctx):
> assert flask.g.get("x") is None
tests/test_basic.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'g'
def _lookup_app_object(name):
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:40: RuntimeError
____________________________________________________________________________ test_make_response ____________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_make_response(app, req_ctx):
> rv = flask.make_response()
tests/test_basic.py:1262:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:188: in make_response
return current_app.response_class()
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
___________________________________________________________________________ test_url_generation ____________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_url_generation(app, req_ctx):
@app.route("/hello/<name>", methods=["POST"])
def hello():
pass
> assert flask.url_for("hello", name="test x") == "/hello/test%20x"
tests/test_basic.py:1347:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
endpoint = 'hello', values = {'name': 'test x'}, appctx = None, reqctx = None
def url_for(endpoint: str, **values: t.Any) -> str:
"""Generates a URL to the given endpoint with the method provided.
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is ``None``, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (``.``).
This will reference the index function local to the current blueprint::
url_for('.index')
See :ref:`url-building`.
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
generating URLs outside of a request context.
To integrate applications, :class:`Flask` has a hook to intercept URL build
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
function results in a :exc:`~werkzeug.routing.BuildError` when the current
app does not have a URL for the given endpoint and values. When it does, the
:data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
it is not ``None``, which can return a string to use as the result of
`url_for` (instead of `url_for`'s default to raise the
:exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type(exc_value).with_traceback(tb)
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.url_build_error_handlers.append(external_url_handler)
Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
`endpoint` and `values` are the arguments passed into `url_for`. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The `_scheme` parameter was added.
.. versionadded:: 0.9
The `_anchor` and `_method` parameters were added.
.. versionadded:: 0.9
Calls :meth:`Flask.handle_build_error` on
:exc:`~werkzeug.routing.BuildError`.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to ``True``, an absolute URL is generated. Server
address can be changed via ``SERVER_NAME`` configuration variable which
falls back to the `Host` header, then to the IP and port of the request.
:param _scheme: a string specifying the desired URL scheme. The `_external`
parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
behavior uses the same scheme as the current request, or
:data:`PREFERRED_URL_SCHEME` if no request context is available.
This also can be set to an empty string to build protocol-relative
URLs.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
> raise RuntimeError(
"Attempted to generate a URL without the application context being"
" pushed. This has to be executed when application context is"
" available."
)
E RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:274: RuntimeError
_________________________________________________________________________ test_jsonify_prettyprint _________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_jsonify_prettyprint(app, req_ctx):
app.config.update({"JSONIFY_PRETTYPRINT_REGULAR": True})
compressed_msg = {"msg": {"submsg": "W00t"}, "msg2": "foobar"}
pretty_response = (
b'{\n "msg": {\n "submsg": "W00t"\n }, \n "msg2": "foobar"\n}\n'
)
> rv = flask.make_response(flask.jsonify(compressed_msg), 200)
tests/test_basic.py:1315:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/json/__init__.py:343: in jsonify
if current_app.config["JSONIFY_PRETTYPRINT_REGULAR"] or current_app.debug:
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
____________________________________________________________________ test_jsonify_args_and_kwargs_check ____________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_jsonify_args_and_kwargs_check(app, req_ctx):
with pytest.raises(TypeError) as e:
> flask.jsonify("fake args", kwargs="fake")
tests/test_basic.py:1338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/json/__init__.py:343: in jsonify
if current_app.config["JSONIFY_PRETTYPRINT_REGULAR"] or current_app.debug:
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
________________________________________________________________ test_make_response_with_response_instance _________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_make_response_with_response_instance(app, req_ctx):
> rv = flask.make_response(flask.jsonify({"msg": "W00t"}), 400)
tests/test_basic.py:1279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/json/__init__.py:343: in jsonify
if current_app.config["JSONIFY_PRETTYPRINT_REGULAR"] or current_app.debug:
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
_______________________________________________________________________________ test_flashes _______________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_flashes(app, req_ctx):
> assert not flask.session.modified
tests/test_basic.py:598:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'session'
def _lookup_req_object(name):
top = _request_ctx_stack.top
if top is None:
> raise RuntimeError(_request_ctx_err_msg)
E RuntimeError: Working outside of request context.
E
E This typically means that you attempted to use functionality that needed
E an active HTTP request. Consult the documentation on testing for
E information about how to avoid this problem.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:33: RuntimeError
__________________________________________________________________________ test_jsonify_mimetype ___________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_jsonify_mimetype(app, req_ctx):
app.config.update({"JSONIFY_MIMETYPE": "application/vnd.api+json"})
msg = {"msg": {"submsg": "W00t"}}
> rv = flask.make_response(flask.jsonify(msg), 200)
tests/test_basic.py:1322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/json/__init__.py:343: in jsonify
if current_app.config["JSONIFY_PRETTYPRINT_REGULAR"] or current_app.debug:
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
________________________________________________________________________ test_g_iteration_protocol _________________________________________________________________________
app_ctx = <flask.ctx.AppContext object at 0x7f1826968b80>
def test_g_iteration_protocol(app_ctx):
> flask.g.foo = 23
tests/test_basic.py:1834:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'g'
def _lookup_app_object(name):
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:40: RuntimeError
_______________________________________________________________________ test_jsonify_no_prettyprint ________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_jsonify_no_prettyprint(app, req_ctx):
app.config.update({"JSONIFY_PRETTYPRINT_REGULAR": False})
compressed_msg = b'{"msg":{"submsg":"W00t"},"msg2":"foobar"}\n'
uncompressed_msg = {"msg": {"submsg": "W00t"}, "msg2": "foobar"}
> rv = flask.make_response(flask.jsonify(uncompressed_msg), 200)
tests/test_basic.py:1304:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/json/__init__.py:343: in jsonify
if current_app.config["JSONIFY_PRETTYPRINT_REGULAR"] or current_app.debug:
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
_______________________________________________________________________ test_request_less_rendering ________________________________________________________________________
app = <Flask 'flask_test'>, app_ctx = <flask.ctx.AppContext object at 0x7f18269792b0>
def test_request_less_rendering(app, app_ctx):
app.config["WORLD_NAME"] = "Special World"
@app.context_processor
def context_processor():
return dict(foo=42)
> rv = flask.render_template_string("Hello {{ config.WORLD_NAME }} {{ foo }}")
tests/test_templating.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
source = 'Hello {{ config.WORLD_NAME }} {{ foo }}', context = {}, ctx = None
def render_template_string(source: str, **context: t.Any) -> str:
"""Renders a template from the given template source string
with the given context. Template variables will be autoescaped.
:param source: the source code of the template to be
rendered
:param context: the variables that should be available in the
context of the template.
"""
ctx = _app_ctx_stack.top
> ctx.app.update_template_context(context)
E AttributeError: 'NoneType' object has no attribute 'app'
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/templating.py:164: AttributeError
_______________________________________________________________________________ test_macros ________________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_macros(app, req_ctx):
> macro = flask.get_template_attribute("_macro.html", "hello")
tests/test_templating.py:109:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:364: in get_template_attribute
return getattr(current_app.jinja_env.get_template(template_name).module, attribute)
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
_________________________________________________________________________ test_add_template_global _________________________________________________________________________
app = <Flask 'flask_test'>, app_ctx = <flask.ctx.AppContext object at 0x7f1826f8ce20>
def test_add_template_global(app, app_ctx):
@app.template_global()
def get_stuff():
return 42
assert "get_stuff" in app.jinja_env.globals.keys()
assert app.jinja_env.globals["get_stuff"] == get_stuff
assert app.jinja_env.globals["get_stuff"](), 42
> rv = flask.render_template_string("{{ get_stuff() }}")
tests/test_templating.py:310:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
source = '{{ get_stuff() }}', context = {}, ctx = None
def render_template_string(source: str, **context: t.Any) -> str:
"""Renders a template from the given template source string
with the given context. Template variables will be autoescaped.
:param source: the source code of the template to be
rendered
:param context: the variables that should be available in the
context of the template.
"""
ctx = _app_ctx_stack.top
> ctx.app.update_template_context(context)
E AttributeError: 'NoneType' object has no attribute 'app'
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/templating.py:164: AttributeError
_________________________________________________________________ test_escaping_without_template_filename __________________________________________________________________
app = <Flask 'flask_test'>, client = <FlaskClient <Flask 'flask_test'>>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_escaping_without_template_filename(app, client, req_ctx):
> assert flask.render_template_string("{{ foo }}", foo="<test>") == "<test>"
tests/test_templating.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
source = '{{ foo }}', context = {'foo': '<test>'}, ctx = None
def render_template_string(source: str, **context: t.Any) -> str:
"""Renders a template from the given template source string
with the given context. Template variables will be autoescaped.
:param source: the source code of the template to be
rendered
:param context: the variables that should be available in the
context of the template.
"""
ctx = _app_ctx_stack.top
> ctx.app.update_template_context(context)
E AttributeError: 'NoneType' object has no attribute 'app'
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/templating.py:164: AttributeError
________________________________________________________________________ test_environ_base_default _________________________________________________________________________
app = <Flask 'flask_test'>, client = <FlaskClient <Flask 'flask_test'>>, app_ctx = <flask.ctx.AppContext object at 0x7f1826f324f0>
def test_environ_base_default(app, client, app_ctx):
@app.route("/")
def index():
flask.g.user_agent = flask.request.headers["User-Agent"]
return flask.request.remote_addr
rv = client.get("/")
assert rv.data == b"127.0.0.1"
> assert flask.g.user_agent == f"werkzeug/{werkzeug.__version__}"
tests/test_testing.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'g'
def _lookup_app_object(name):
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:40: RuntimeError
__________________________________________________________________ test_session_transactions_keep_context __________________________________________________________________
app = <Flask 'flask_test'>, client = <FlaskClient <Flask 'flask_test'>>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_session_transactions_keep_context(app, client, req_ctx):
client.get("/")
> req = flask.request._get_current_object()
tests/test_testing.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'request'
def _lookup_req_object(name):
top = _request_ctx_stack.top
if top is None:
> raise RuntimeError(_request_ctx_err_msg)
E RuntimeError: Working outside of request context.
E
E This typically means that you attempted to use functionality that needed
E an active HTTP request. Consult the documentation on testing for
E information about how to avoid this problem.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:33: RuntimeError
________________________________________________________________________ test_environ_base_modified ________________________________________________________________________
app = <Flask 'flask_test'>, client = <FlaskClient <Flask 'flask_test'>>, app_ctx = <flask.ctx.AppContext object at 0x7f1826e4aa90>
def test_environ_base_modified(app, client, app_ctx):
@app.route("/")
def index():
flask.g.user_agent = flask.request.headers["User-Agent"]
return flask.request.remote_addr
client.environ_base["REMOTE_ADDR"] = "0.0.0.0"
client.environ_base["HTTP_USER_AGENT"] = "Foo"
rv = client.get("/")
assert rv.data == b"0.0.0.0"
> assert flask.g.user_agent == "Foo"
tests/test_testing.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'g'
def _lookup_app_object(name):
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:40: RuntimeError
______________________________________________________________________ test_client_pop_all_preserved _______________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>, client = <FlaskClient <Flask 'flask_test'>>
def test_client_pop_all_preserved(app, req_ctx, client):
@app.route("/")
def index():
# stream_with_context pushes a third context, preserved by client
return flask.Response(flask.stream_with_context("hello"))
# req_ctx fixture pushed an initial context, not marked preserved
with client:
# request pushes a second request context, preserved by client
client.get("/")
# only req_ctx fixture should still be pushed
> assert flask._request_ctx_stack.top is req_ctx
E AssertionError: assert None is <RequestContext 'http://localhost/' [GET] of flask_test>
E + where None = <werkzeug.local.LocalStack object at 0x7f16952bd9a0>.top
E + where <werkzeug.local.LocalStack object at 0x7f16952bd9a0> = flask._request_ctx_stack
tests/test_testing.py:424: AssertionError
_______________________________________________________________________ test_app_ctx_globals_methods _______________________________________________________________________
app = <Flask 'flask_test'>, app_ctx = <flask.ctx.AppContext object at 0x7f1826830dc0>
def test_app_ctx_globals_methods(app, app_ctx):
# get
> assert flask.g.get("foo") is None
tests/test_appctx.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'g'
def _lookup_app_object(name):
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:40: RuntimeError
__________________________________________________________________ TestSendfile.test_send_from_directory ___________________________________________________________________
self = <test_helpers.TestSendfile object at 0x7f1826a96c40>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_send_from_directory(self, app, req_ctx):
app.root_path = os.path.join(
os.path.dirname(__file__), "test_apps", "subdomaintestmodule"
)
> rv = flask.send_from_directory("static", "hello.txt")
tests/test_helpers.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:701: in send_from_directory
directory, path, **_prepare_send_file_kwargs(**kwargs)
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:482: in _prepare_send_file_kwargs
max_age = current_app.get_send_file_max_age
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
______________________________________________________________________ TestSendfile.test_static_file _______________________________________________________________________
self = <test_helpers.TestSendfile object at 0x7f18266e22e0>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_static_file(self, app, req_ctx):
# Default max_age is None.
# Test with static file handler.
> rv = app.send_static_file("index.html")
tests/test_helpers.py:49:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/scaffold.py:331: in send_static_file
max_age = self.get_send_file_max_age(filename)
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/scaffold.py:311: in get_send_file_max_age
value = current_app.send_file_max_age_default
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _find_app():
top = _app_ctx_stack.top
if top is None:
> raise RuntimeError(_app_ctx_err_msg)
E RuntimeError: Working outside of application context.
E
E This typically means that you attempted to use functionality that needed
E to interface with the current application object in some way. To solve
E this, set up an application context with app.app_context(). See the
E documentation for more information.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:47: RuntimeError
_______________________________________________________________________ TestSendfile.test_send_file ________________________________________________________________________
self = <test_helpers.TestSendfile object at 0x7f18266ba400>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_send_file(self, app, req_ctx):
> rv = flask.send_file("static/index.html")
tests/test_helpers.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:615: in send_file
environ=request.environ,
/usr/lib/python3.8/site-packages/werkzeug/local.py:422: in __get__
obj = instance._get_current_object()
/usr/lib/python3.8/site-packages/werkzeug/local.py:544: in _get_current_object
return self.__local() # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'request'
def _lookup_req_object(name):
top = _request_ctx_stack.top
if top is None:
> raise RuntimeError(_request_ctx_err_msg)
E RuntimeError: Working outside of request context.
E
E This typically means that you attempted to use functionality that needed
E an active HTTP request. Consult the documentation on testing for
E information about how to avoid this problem.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/globals.py:33: RuntimeError
_____________________________________________________________________ TestUrlFor.test_url_with_method ______________________________________________________________________
self = <test_helpers.TestUrlFor object at 0x7f182659f9d0>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_url_with_method(self, app, req_ctx):
from flask.views import MethodView
class MyView(MethodView):
def get(self, id=None):
if id is None:
return "List"
return f"Get {id:d}"
def post(self):
return "Create"
myview = MyView.as_view("myview")
app.add_url_rule("/myview/", methods=["GET"], view_func=myview)
app.add_url_rule("/myview/<int:id>", methods=["GET"], view_func=myview)
app.add_url_rule("/myview/create", methods=["POST"], view_func=myview)
> assert flask.url_for("myview", _method="GET") == "/myview/"
tests/test_helpers.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
endpoint = 'myview', values = {'_method': 'GET'}, appctx = None, reqctx = None
def url_for(endpoint: str, **values: t.Any) -> str:
"""Generates a URL to the given endpoint with the method provided.
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is ``None``, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (``.``).
This will reference the index function local to the current blueprint::
url_for('.index')
See :ref:`url-building`.
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
generating URLs outside of a request context.
To integrate applications, :class:`Flask` has a hook to intercept URL build
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
function results in a :exc:`~werkzeug.routing.BuildError` when the current
app does not have a URL for the given endpoint and values. When it does, the
:data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
it is not ``None``, which can return a string to use as the result of
`url_for` (instead of `url_for`'s default to raise the
:exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type(exc_value).with_traceback(tb)
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.url_build_error_handlers.append(external_url_handler)
Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
`endpoint` and `values` are the arguments passed into `url_for`. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The `_scheme` parameter was added.
.. versionadded:: 0.9
The `_anchor` and `_method` parameters were added.
.. versionadded:: 0.9
Calls :meth:`Flask.handle_build_error` on
:exc:`~werkzeug.routing.BuildError`.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to ``True``, an absolute URL is generated. Server
address can be changed via ``SERVER_NAME`` configuration variable which
falls back to the `Host` header, then to the IP and port of the request.
:param _scheme: a string specifying the desired URL scheme. The `_external`
parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
behavior uses the same scheme as the current request, or
:data:`PREFERRED_URL_SCHEME` if no request context is available.
This also can be set to an empty string to build protocol-relative
URLs.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
> raise RuntimeError(
"Attempted to generate a URL without the application context being"
" pushed. This has to be executed when application context is"
" available."
)
E RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:274: RuntimeError
_____________________________________________________________ TestUrlFor.test_url_for_with_alternating_schemes _____________________________________________________________
self = <test_helpers.TestUrlFor object at 0x7f182665e8e0>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_url_for_with_alternating_schemes(self, app, req_ctx):
@app.route("/")
def index():
return "42"
> assert flask.url_for("index", _external=True) == "http://localhost/"
tests/test_helpers.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
endpoint = 'index', values = {'_external': True}, appctx = None, reqctx = None
def url_for(endpoint: str, **values: t.Any) -> str:
"""Generates a URL to the given endpoint with the method provided.
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is ``None``, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (``.``).
This will reference the index function local to the current blueprint::
url_for('.index')
See :ref:`url-building`.
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
generating URLs outside of a request context.
To integrate applications, :class:`Flask` has a hook to intercept URL build
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
function results in a :exc:`~werkzeug.routing.BuildError` when the current
app does not have a URL for the given endpoint and values. When it does, the
:data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
it is not ``None``, which can return a string to use as the result of
`url_for` (instead of `url_for`'s default to raise the
:exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type(exc_value).with_traceback(tb)
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.url_build_error_handlers.append(external_url_handler)
Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
`endpoint` and `values` are the arguments passed into `url_for`. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The `_scheme` parameter was added.
.. versionadded:: 0.9
The `_anchor` and `_method` parameters were added.
.. versionadded:: 0.9
Calls :meth:`Flask.handle_build_error` on
:exc:`~werkzeug.routing.BuildError`.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to ``True``, an absolute URL is generated. Server
address can be changed via ``SERVER_NAME`` configuration variable which
falls back to the `Host` header, then to the IP and port of the request.
:param _scheme: a string specifying the desired URL scheme. The `_external`
parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
behavior uses the same scheme as the current request, or
:data:`PREFERRED_URL_SCHEME` if no request context is available.
This also can be set to an empty string to build protocol-relative
URLs.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
> raise RuntimeError(
"Attempted to generate a URL without the application context being"
" pushed. This has to be executed when application context is"
" available."
)
E RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:274: RuntimeError
___________________________________________________________________ TestUrlFor.test_url_for_with_anchor ____________________________________________________________________
self = <test_helpers.TestUrlFor object at 0x7f182663d9d0>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_url_for_with_anchor(self, app, req_ctx):
@app.route("/")
def index():
return "42"
> assert flask.url_for("index", _anchor="x y") == "/#x%20y"
tests/test_helpers.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
endpoint = 'index', values = {'_anchor': 'x y'}, appctx = None, reqctx = None
def url_for(endpoint: str, **values: t.Any) -> str:
"""Generates a URL to the given endpoint with the method provided.
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is ``None``, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (``.``).
This will reference the index function local to the current blueprint::
url_for('.index')
See :ref:`url-building`.
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
generating URLs outside of a request context.
To integrate applications, :class:`Flask` has a hook to intercept URL build
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
function results in a :exc:`~werkzeug.routing.BuildError` when the current
app does not have a URL for the given endpoint and values. When it does, the
:data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
it is not ``None``, which can return a string to use as the result of
`url_for` (instead of `url_for`'s default to raise the
:exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type(exc_value).with_traceback(tb)
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.url_build_error_handlers.append(external_url_handler)
Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
`endpoint` and `values` are the arguments passed into `url_for`. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The `_scheme` parameter was added.
.. versionadded:: 0.9
The `_anchor` and `_method` parameters were added.
.. versionadded:: 0.9
Calls :meth:`Flask.handle_build_error` on
:exc:`~werkzeug.routing.BuildError`.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to ``True``, an absolute URL is generated. Server
address can be changed via ``SERVER_NAME`` configuration variable which
falls back to the `Host` header, then to the IP and port of the request.
:param _scheme: a string specifying the desired URL scheme. The `_external`
parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
behavior uses the same scheme as the current request, or
:data:`PREFERRED_URL_SCHEME` if no request context is available.
This also can be set to an empty string to build protocol-relative
URLs.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
> raise RuntimeError(
"Attempted to generate a URL without the application context being"
" pushed. This has to be executed when application context is"
" available."
)
E RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:274: RuntimeError
___________________________________________________________________ TestUrlFor.test_url_for_with_scheme ____________________________________________________________________
self = <test_helpers.TestUrlFor object at 0x7f18265a43a0>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_url_for_with_scheme(self, app, req_ctx):
@app.route("/")
def index():
return "42"
> assert (
flask.url_for("index", _external=True, _scheme="https")
== "https://localhost/"
)
tests/test_helpers.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
endpoint = 'index', values = {'_external': True, '_scheme': 'https'}, appctx = None, reqctx = None
def url_for(endpoint: str, **values: t.Any) -> str:
"""Generates a URL to the given endpoint with the method provided.
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is ``None``, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (``.``).
This will reference the index function local to the current blueprint::
url_for('.index')
See :ref:`url-building`.
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
generating URLs outside of a request context.
To integrate applications, :class:`Flask` has a hook to intercept URL build
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
function results in a :exc:`~werkzeug.routing.BuildError` when the current
app does not have a URL for the given endpoint and values. When it does, the
:data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
it is not ``None``, which can return a string to use as the result of
`url_for` (instead of `url_for`'s default to raise the
:exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type(exc_value).with_traceback(tb)
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.url_build_error_handlers.append(external_url_handler)
Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
`endpoint` and `values` are the arguments passed into `url_for`. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The `_scheme` parameter was added.
.. versionadded:: 0.9
The `_anchor` and `_method` parameters were added.
.. versionadded:: 0.9
Calls :meth:`Flask.handle_build_error` on
:exc:`~werkzeug.routing.BuildError`.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to ``True``, an absolute URL is generated. Server
address can be changed via ``SERVER_NAME`` configuration variable which
falls back to the `Host` header, then to the IP and port of the request.
:param _scheme: a string specifying the desired URL scheme. The `_external`
parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
behavior uses the same scheme as the current request, or
:data:`PREFERRED_URL_SCHEME` if no request context is available.
This also can be set to an empty string to build protocol-relative
URLs.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
> raise RuntimeError(
"Attempted to generate a URL without the application context being"
" pushed. This has to be executed when application context is"
" available."
)
E RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:274: RuntimeError
_____________________________________________________________ TestUrlFor.test_url_for_with_scheme_not_external _____________________________________________________________
self = <test_helpers.TestUrlFor object at 0x7f18266450d0>, app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_url_for_with_scheme_not_external(self, app, req_ctx):
@app.route("/")
def index():
return "42"
> pytest.raises(ValueError, flask.url_for, "index", _scheme="https")
tests/test_helpers.py:125:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
endpoint = 'index', values = {'_scheme': 'https'}, appctx = None, reqctx = None
def url_for(endpoint: str, **values: t.Any) -> str:
"""Generates a URL to the given endpoint with the method provided.
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is ``None``, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (``.``).
This will reference the index function local to the current blueprint::
url_for('.index')
See :ref:`url-building`.
Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
generating URLs outside of a request context.
To integrate applications, :class:`Flask` has a hook to intercept URL build
errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
function results in a :exc:`~werkzeug.routing.BuildError` when the current
app does not have a URL for the given endpoint and values. When it does, the
:data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
it is not ``None``, which can return a string to use as the result of
`url_for` (instead of `url_for`'s default to raise the
:exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type(exc_value).with_traceback(tb)
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.url_build_error_handlers.append(external_url_handler)
Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
`endpoint` and `values` are the arguments passed into `url_for`. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The `_scheme` parameter was added.
.. versionadded:: 0.9
The `_anchor` and `_method` parameters were added.
.. versionadded:: 0.9
Calls :meth:`Flask.handle_build_error` on
:exc:`~werkzeug.routing.BuildError`.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to ``True``, an absolute URL is generated. Server
address can be changed via ``SERVER_NAME`` configuration variable which
falls back to the `Host` header, then to the IP and port of the request.
:param _scheme: a string specifying the desired URL scheme. The `_external`
parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
behavior uses the same scheme as the current request, or
:data:`PREFERRED_URL_SCHEME` if no request context is available.
This also can be set to an empty string to build protocol-relative
URLs.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
> raise RuntimeError(
"Attempted to generate a URL without the application context being"
" pushed. This has to be executed when application context is"
" available."
)
E RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available.
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/helpers.py:274: RuntimeError
___________________________________________________________________ test_json_as_unicode[False-"\u2603"] ___________________________________________________________________
test_value = False, expected = '"☃"', app = <Flask 'flask_test'>, app_ctx = <flask.ctx.AppContext object at 0x7f182cbab6d0>
@pytest.mark.parametrize(
"test_value,expected", [(True, '"\\u2603"'), (False, '"\u2603"')]
)
def test_json_as_unicode(test_value, expected, app, app_ctx):
app.config["JSON_AS_ASCII"] = test_value
rv = flask.json.dumps("\N{SNOWMAN}")
> assert rv == expected
E assert '"\\u2603"' == '"☃"'
E - "☃"
E + "\u2603"
tests/test_json.py:54: AssertionError
____________________________________________________________________________ test_tojson_filter ____________________________________________________________________________
app = <Flask 'flask_test'>, req_ctx = <RequestContext 'http://localhost/' [GET] of flask_test>
def test_tojson_filter(app, req_ctx):
# The tojson filter is tested in Jinja, this confirms that it's
# using Flask's dumps.
> rv = flask.render_template_string(
"const data = {{ data|tojson }};",
data={"name": "</script>", "time": datetime.datetime(2021, 2, 1, 7, 15)},
)
tests/test_json.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
source = 'const data = {{ data|tojson }};', context = {'data': {'name': '</script>', 'time': datetime.datetime(2021, 2, 1, 7, 15)}}, ctx = None
def render_template_string(source: str, **context: t.Any) -> str:
"""Renders a template from the given template source string
with the given context. Template variables will be autoescaped.
:param source: the source code of the template to be
rendered
:param context: the variables that should be available in the
context of the template.
"""
ctx = _app_ctx_stack.top
> ctx.app.update_template_context(context)
E AttributeError: 'NoneType' object has no attribute 'app'
../../BUILDROOT/python-flask-2.0.2-3.fc35.x86_64/usr/lib/python3.8/site-packages/flask/templating.py:164: AttributeError
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_async.py:159: should only raise Python < 3.7
XPASS tests/test_instance_config.py::test_uninstalled_module_paths weird interaction with tox
XPASS tests/test_instance_config.py::test_uninstalled_package_paths weird interaction with tox
XPASS tests/test_instance_config.py::test_main_module_paths weird interaction with tox
FAILED tests/test_basic.py::test_get_method_on_g - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_make_response - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_url_generation - RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be executed when ap...
FAILED tests/test_basic.py::test_jsonify_prettyprint - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_jsonify_args_and_kwargs_check - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_make_response_with_response_instance - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_flashes - RuntimeError: Working outside of request context.
FAILED tests/test_basic.py::test_jsonify_mimetype - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_g_iteration_protocol - RuntimeError: Working outside of application context.
FAILED tests/test_basic.py::test_jsonify_no_prettyprint - RuntimeError: Working outside of application context.
FAILED tests/test_templating.py::test_request_less_rendering - AttributeError: 'NoneType' object has no attribute 'app'
FAILED tests/test_templating.py::test_macros - RuntimeError: Working outside of application context.
FAILED tests/test_templating.py::test_add_template_global - AttributeError: 'NoneType' object has no attribute 'app'
FAILED tests/test_templating.py::test_escaping_without_template_filename - AttributeError: 'NoneType' object has no attribute 'app'
FAILED tests/test_testing.py::test_environ_base_default - RuntimeError: Working outside of application context.
FAILED tests/test_testing.py::test_session_transactions_keep_context - RuntimeError: Working outside of request context.
FAILED tests/test_testing.py::test_environ_base_modified - RuntimeError: Working outside of application context.
FAILED tests/test_testing.py::test_client_pop_all_preserved - AssertionError: assert None is <RequestContext 'http://localhost/' [GET] of flask_test>
FAILED tests/test_appctx.py::test_app_ctx_globals_methods - RuntimeError: Working outside of application context.
FAILED tests/test_helpers.py::TestSendfile::test_send_from_directory - RuntimeError: Working outside of application context.
FAILED tests/test_helpers.py::TestSendfile::test_static_file - RuntimeError: Working outside of application context.
FAILED tests/test_helpers.py::TestSendfile::test_send_file - RuntimeError: Working outside of request context.
FAILED tests/test_helpers.py::TestUrlFor::test_url_with_method - RuntimeError: Attempted to generate a URL without the application context being pushed. This has to be e...
FAILED tests/test_helpers.py::TestUrlFor::test_url_for_with_alternating_schemes - RuntimeError: Attempted to generate a URL without the application context being pushed....
FAILED tests/test_helpers.py::TestUrlFor::test_url_for_with_anchor - RuntimeError: Attempted to generate a URL without the application context being pushed. This has to ...
FAILED tests/test_helpers.py::TestUrlFor::test_url_for_with_scheme - RuntimeError: Attempted to generate a URL without the application context being pushed. This has to ...
FAILED tests/test_helpers.py::TestUrlFor::test_url_for_with_scheme_not_external - RuntimeError: Attempted to generate a URL without the application context being pushed....
FAILED tests/test_json.py::test_json_as_unicode[False-"\u2603"] - assert '"\\u2603"' == '"☃"'
FAILED tests/test_json.py::test_tojson_filter - AttributeError: 'NoneType' object has no attribute 'app'
=========================================================== 29 failed, 446 passed, 1 skipped, 3 xpassed in 7.95s ===========================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
Looks like pytest is failing in few ubits.
Environment:
I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
Here is the pytest output
Details