Skip to content
Myr

Merge remote-tracking branch 'origin/1.1.x'

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

authored by David Lord · committed by David Lord · parents a250997, 42942ec · Browse files · 2 files+10 added−4 removed
This commit

State

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

Diff stats

2 files+10 added−4 removed

  • tests:+8 added−2 removed
  • other:+2 added−2 removed

2 files+10 added−4 removed

modified:docs/reqcontext.rst+2 added-2 removed
168 unmodified lines
169will not fail.170171During testing, it can be useful to defer popping the contexts after the172request ends, so that their data can be accessed in the test function.173Using the :meth:`~Flask.test_client` as a ``with`` block to preserve the174contexts until the with block exits.173Use the :meth:`~Flask.test_client` as a ``with`` block to preserve the174contexts until the ``with`` block exits.175176.. code-block:: python177178 from flask import Flask, request
88 unmodified lines
modified:tests/test_helpers.py+8 added-2 removed
9 unmodified lines
10"""11import datetime12import io13import os14import sys15import uuid1617import pytest18from werkzeug.datastructures import Range
761 unmodified lines
780 rv.direct_passthrough = False781 assert rv.data.strip() == b"Hello Subdomain"782 rv.close()783783 def test_send_from_directory_bad_request(self, app, req_ctx):784 def test_send_from_directory_null_character(self, app, req_ctx):785 app.root_path = os.path.join(786 os.path.dirname(__file__), "test_apps", "subdomaintestmodule"787 )788789 if sys.version_info >= (3, 8):790 exception = NotFound791 else:792 exception = BadRequest793788 with pytest.raises(BadRequest):794 with pytest.raises(exception):795 flask.send_from_directory("static", "bad\x00")796797798class TestUrlFor(object):
252 unmodified lines