test no debug flag doesn't reconfigure

test templates_auto_reload property instead of config
use app fixture in test
This commit is contained in:
David Lord 2017-06-14 12:31:56 -07:00
parent 4fc48200a5
commit 4d2a3ab2e0
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
1 changed files with 7 additions and 7 deletions

View File

@ -386,19 +386,19 @@ def test_templates_auto_reload(app):
app.config['TEMPLATES_AUTO_RELOAD'] = True
assert app.jinja_env.auto_reload is True
def test_templates_auto_reload_debug_run(monkeypatch):
# debug is None in config, config option is None, app.run(debug=True)
# Mocks werkzeug.serving.run_simple method
def test_templates_auto_reload_debug_run(app, monkeypatch):
def run_simple_mock(*args, **kwargs):
pass
app = flask.Flask(__name__)
monkeypatch.setattr(werkzeug.serving, 'run_simple', run_simple_mock)
assert app.config['TEMPLATES_AUTO_RELOAD'] is None
assert app.jinja_env.auto_reload is False
app.run()
assert app.templates_auto_reload == False
assert app.jinja_env.auto_reload == False
app.run(debug=True)
assert app.jinja_env.auto_reload is True
assert app.templates_auto_reload == True
assert app.jinja_env.auto_reload == True
def test_template_loader_debugging(test_apps):