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
Provenance
- Commit
861aa0d- Tree
e8b3881- Author
Markus Unterwaditzer <markus@unterwaditzer.net>- Committer
Markus Unterwaditzer <markus@unterwaditzer.net>- Parent
588cfa9
4 files changed+19 added−19 removed
modified:tests/conftest.py+2 added-2 removed
12 unmodified lines13 import pytest14 import textwrap15 16 17-@pytest.fixture(autouse=True)18-def setup_path(monkeypatch):17+@pytest.fixture18+def test_apps(monkeypatch):19 monkeypatch.syspath_prepend(20 os.path.abspath(os.path.join(21 os.path.dirname(__file__), 'test_apps'))22 )105 unmodified linesmodified:tests/test_blueprints.py+2 added-2 removed
138 unmodified lines139 140 assert c.get('/de/').data == b'/de/about'141 assert c.get('/de/about').data == b'/de/'142 143-def test_templates_and_static():143+def test_templates_and_static(test_apps):144 from blueprintapp import app145 c = app.test_client()146 147 rv = c.get('/')60 unmodified lines208 rv.close()209 finally:210 app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default211 212-def test_templates_list():212+def 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 linesmodified:tests/test_ext.py+14 added-14 removed
50 unmodified lines51 assert '.' not in key52 53 request.addfinalizer(teardown)54 55-def test_flaskext_new_simple_import_normal():55+def test_flaskext_new_simple_import_normal(test_apps):56 from flask.ext.newext_simple import ext_id57 assert ext_id == 'newext_simple'58 59-def test_flaskext_new_simple_import_module():59+def 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'63 64-def test_flaskext_new_package_import_normal():64+def test_flaskext_new_package_import_normal(test_apps):65 from flask.ext.newext_package import ext_id66 assert ext_id == 'newext_package'67 68-def test_flaskext_new_package_import_module():68+def 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'72 73-def test_flaskext_new_package_import_submodule_function():73+def test_flaskext_new_package_import_submodule_function(test_apps):74 from flask.ext.newext_package.submodule import test_function75 assert test_function() == 4276 77-def test_flaskext_new_package_import_submodule():77+def 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() == 4281 82-def test_flaskext_old_simple_import_normal():82+def test_flaskext_old_simple_import_normal(test_apps):83 from flask.ext.oldext_simple import ext_id84 assert ext_id == 'oldext_simple'85 86-def test_flaskext_old_simple_import_module():86+def 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'90 91-def test_flaskext_old_package_import_normal():91+def test_flaskext_old_package_import_normal(test_apps):92 from flask.ext.oldext_package import ext_id93 assert ext_id == 'oldext_package'94 95-def test_flaskext_old_package_import_module():95+def 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'99 100-def test_flaskext_old_package_import_submodule():100+def 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() == 42104 105-def test_flaskext_old_package_import_submodule_function():105+def test_flaskext_old_package_import_submodule_function(test_apps):106 from flask.ext.oldext_package.submodule import test_function107 assert test_function() == 42108 109-def test_flaskext_broken_package_no_module_caching():109+def test_flaskext_broken_package_no_module_caching(test_apps):110 for x in range(2):111 with pytest.raises(ImportError):112 import flask.ext.broken113 114-def test_no_error_swallowing():114+def 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 linesmodified:tests/test_templating.py+1 added-1 removed
304 unmodified lines305 app = flask.Flask(__name__)306 app.config['TEMPLATES_AUTO_RELOAD'] = False307 assert not app.jinja_env.auto_reload308 309-def test_template_loader_debugging():309+def test_template_loader_debugging(test_apps):310 from blueprintapp import app311 312 called = []313 class _TestHandler(logging.Handler):29 unmodified lines