Skip to content
Myr

Add test for new template auto reload debug behaviour

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

authored by Dave Barker · committed by Dave Barker · parent 0514ba2 · Browse files · 1 file+17 added−0 removed
This commit

State

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

Diff stats

1 file+17 added−0 removed

  • tests:+17 added−0 removed

1 file+17 added−0 removed

modified:tests/test_templating.py+17 added
12 unmodified lines
1314import flask15import logging16from jinja2 import TemplateNotFound17import werkzeug.serving181920def test_context_processing():21 app = flask.Flask(__name__)
324 unmodified lines
346 app.config['DEBUG'] = True347 app.config['TEMPLATES_AUTO_RELOAD'] = True348 assert app.jinja_env.auto_reload is True349350def test_templates_auto_reload_debug_run(monkeypatch):351 # debug is None in config, config option is None, app.run(debug=True)352 rv = {}353354 # Mocks werkzeug.serving.run_simple method355 def run_simple_mock(*args, **kwargs):356 rv['passthrough_errors'] = kwargs.get('passthrough_errors')357358 app = flask.Flask(__name__)359 monkeypatch.setattr(werkzeug.serving, 'run_simple', run_simple_mock)360361 assert app.config['TEMPLATES_AUTO_RELOAD'] is None362 assert app.jinja_env.auto_reload is False363 app.run(debug=True)364 assert app.jinja_env.auto_reload is True365366def test_template_loader_debugging(test_apps):367 from blueprintapp import app368369 called = []
40 unmodified lines