Skip to content
Myr

Init global test_apps explicitly

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

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 588cfa9 · Browse files · 4 files+19 added−19 removed
This commit

State

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

Diff stats

4 files+19 added−19 removed

  • tests:+19 added−19 removed

4 files+19 added−19 removed

modified:tests/conftest.py+2 added-2 removed
12 unmodified lines
13import pytest14import textwrap151617@pytest.fixture(autouse=True)18def setup_path(monkeypatch):17@pytest.fixture18def test_apps(monkeypatch):19 monkeypatch.syspath_prepend(20 os.path.abspath(os.path.join(21 os.path.dirname(__file__), 'test_apps'))22 )
105 unmodified lines
modified:tests/test_blueprints.py+2 added-2 removed
138 unmodified lines
139140 assert c.get('/de/').data == b'/de/about'141 assert c.get('/de/about').data == b'/de/'142143def test_templates_and_static():143def test_templates_and_static(test_apps):144 from blueprintapp import app145 c = app.test_client()146147 rv = c.get('/')
60 unmodified lines
208 rv.close()209 finally:210 app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default211212def test_templates_list():212def test_templates_list(test_apps):213 from blueprintapp import app214 templates = sorted(app.jinja_env.list_templates())215 assert templates == ['admin/index.html', 'frontend/index.html']216
362 unmodified lines
modified:tests/test_ext.py+14 added-14 removed
50 unmodified lines
51 assert '.' not in key5253 request.addfinalizer(teardown)5455def test_flaskext_new_simple_import_normal():55def test_flaskext_new_simple_import_normal(test_apps):56 from flask.ext.newext_simple import ext_id57 assert ext_id == 'newext_simple'5859def test_flaskext_new_simple_import_module():59def test_flaskext_new_simple_import_module(test_apps):60 from flask.ext import newext_simple61 assert newext_simple.ext_id == 'newext_simple'62 assert newext_simple.__name__ == 'flask_newext_simple'6364def test_flaskext_new_package_import_normal():64def test_flaskext_new_package_import_normal(test_apps):65 from flask.ext.newext_package import ext_id66 assert ext_id == 'newext_package'6768def test_flaskext_new_package_import_module():68def test_flaskext_new_package_import_module(test_apps):69 from flask.ext import newext_package70 assert newext_package.ext_id == 'newext_package'71 assert newext_package.__name__ == 'flask_newext_package'7273def test_flaskext_new_package_import_submodule_function():73def test_flaskext_new_package_import_submodule_function(test_apps):74 from flask.ext.newext_package.submodule import test_function75 assert test_function() == 427677def test_flaskext_new_package_import_submodule():77def test_flaskext_new_package_import_submodule(test_apps):78 from flask.ext.newext_package import submodule79 assert submodule.__name__ == 'flask_newext_package.submodule'80 assert submodule.test_function() == 428182def test_flaskext_old_simple_import_normal():82def test_flaskext_old_simple_import_normal(test_apps):83 from flask.ext.oldext_simple import ext_id84 assert ext_id == 'oldext_simple'8586def test_flaskext_old_simple_import_module():86def test_flaskext_old_simple_import_module(test_apps):87 from flask.ext import oldext_simple88 assert oldext_simple.ext_id == 'oldext_simple'89 assert oldext_simple.__name__ == 'flaskext.oldext_simple'9091def test_flaskext_old_package_import_normal():91def test_flaskext_old_package_import_normal(test_apps):92 from flask.ext.oldext_package import ext_id93 assert ext_id == 'oldext_package'9495def test_flaskext_old_package_import_module():95def test_flaskext_old_package_import_module(test_apps):96 from flask.ext import oldext_package97 assert oldext_package.ext_id == 'oldext_package'98 assert oldext_package.__name__ == 'flaskext.oldext_package'99100def test_flaskext_old_package_import_submodule():100def test_flaskext_old_package_import_submodule(test_apps):101 from flask.ext.oldext_package import submodule102 assert submodule.__name__ == 'flaskext.oldext_package.submodule'103 assert submodule.test_function() == 42104105def test_flaskext_old_package_import_submodule_function():105def test_flaskext_old_package_import_submodule_function(test_apps):106 from flask.ext.oldext_package.submodule import test_function107 assert test_function() == 42108109def test_flaskext_broken_package_no_module_caching():109def test_flaskext_broken_package_no_module_caching(test_apps):110 for x in range(2):111 with pytest.raises(ImportError):112 import flask.ext.broken113114def test_no_error_swallowing():114def test_no_error_swallowing(test_apps):115 try:116 import flask.ext.broken117 except ImportError:118 exc_type, exc_value, tb = sys.exc_info()
19 unmodified lines
modified:tests/test_templating.py+1 added-1 removed
304 unmodified lines
305 app = flask.Flask(__name__)306 app.config['TEMPLATES_AUTO_RELOAD'] = False307 assert not app.jinja_env.auto_reload308309def test_template_loader_debugging():309def test_template_loader_debugging(test_apps):310 from blueprintapp import app311312 called = []313 class _TestHandler(logging.Handler):
29 unmodified lines