From 4d2a3ab2e07e36b56d09e16f0836dbd0bdd7b34c Mon Sep 17 00:00:00 2001 From: David Lord Date: Wed, 14 Jun 2017 12:31:56 -0700 Subject: [PATCH] test no debug flag doesn't reconfigure test templates_auto_reload property instead of config use app fixture in test --- tests/test_templating.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_templating.py b/tests/test_templating.py index 18143ba3..aaec54d7 100644 --- a/tests/test_templating.py +++ b/tests/test_templating.py @@ -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):