Cherry-pick 7ba35c4 from master (support pathlib.Path for static_folder)

This commit is contained in:
Joshua Bronson 2020-04-20 13:26:33 -04:00
parent 88c9c68e17
commit b724832872
3 changed files with 22 additions and 1 deletions

View file

@ -1425,6 +1425,16 @@ def test_static_url_empty_path_default(app):
rv.close()
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python >= 3.6")
def test_static_folder_with_pathlib_path(app):
from pathlib import Path
app = flask.Flask(__name__, static_folder=Path("static"))
rv = app.test_client().open("/static/index.html", method="GET")
assert rv.status_code == 200
rv.close()
def test_static_folder_with_ending_slash():
app = flask.Flask(__name__, static_folder="static/")