test_instance_config.py
This file
Path
tests/test_instance_config.py
121 lines · 3.5 KiB · Python
Last changed by
remove unused module docstringsDavid Lordbefore adoptionf2f027d
History of this fileTake it
The walk stopped after 200 commits: lines older than ca23b7b point at it.
Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 1–4why, one step back1import os2import sys34import pytestMerge pull request #3246 from pallets/reorder-importsDavid Lordbefore adoption3db4697
line 5why, one step back5Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 6–10why, one step back6import flask789def test_explicit_instance_paths(modules_tmpdir):10 with pytest.raises(ValueError) as excinfo:Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 11–12why, one step back11 flask.Flask(__name__, instance_path="instance")12 assert "must be absolute" in str(excinfo.value)Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 13–17why, one step back1314 app = flask.Flask(__name__, instance_path=str(modules_tmpdir))15 assert app.instance_path == str(modules_tmpdir)1617Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374
line 18why, one step back18@pytest.mark.xfail(reason="weird interaction with tox")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 19why, one step back19def test_main_module_paths(modules_tmpdir, purge_module):Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 20why, one step back20 app = modules_tmpdir.join("main_app.py")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 21why, one step back21 app.write('import flask\n\napp = flask.Flask("__main__")')Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 22why, one step back22 purge_module("main_app")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 23–24why, one step back2324 from main_app import appMerge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 25why, one step back25Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 26why, one step back26 here = os.path.abspath(os.getcwd())Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 27why, one step back27 assert app.instance_path == os.path.join(here, "instance")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 28–29why, one step back2829Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374
line 30why, one step back30@pytest.mark.xfail(reason="weird interaction with tox")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 31why, one step back31def test_uninstalled_module_paths(modules_tmpdir, purge_module):Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 32–36why, one step back32 app = modules_tmpdir.join("config_module_app.py").write(33 "import os\n"34 "import flask\n"35 "here = os.path.abspath(os.path.dirname(__file__))\n"36 "app = flask.Flask(__name__)\n"Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 37why, one step back37 )Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 38why, one step back38 purge_module("config_module_app")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 39–41why, one step back3940 from config_module_app import app41Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 42why, one step back42 assert app.instance_path == str(modules_tmpdir.join("instance"))Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 43why, one step back43Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 44why, one step back44Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374
line 45why, one step back45@pytest.mark.xfail(reason="weird interaction with tox")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 46why, one step back46def test_uninstalled_package_paths(modules_tmpdir, purge_module):Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 47–48why, one step back47 app = modules_tmpdir.mkdir("config_package_app")48 init = app.join("__init__.py")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 49why, one step back49 init.write(Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 50–53why, one step back50 "import os\n"51 "import flask\n"52 "here = os.path.abspath(os.path.dirname(__file__))\n"53 "app = flask.Flask(__name__)\n"Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 54why, one step back54 )Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 55why, one step back55 purge_module("config_package_app")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 56–58why, one step back5657 from config_package_app import app58Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 59why, one step back59 assert app.instance_path == str(modules_tmpdir.join("instance"))Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 60why, one step back60Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 61–65why, one step back6162def test_installed_module_paths(63 modules_tmpdir, modules_tmpdir_prefix, purge_module, site_packages, limit_loader64):65 site_packages.join("site_app.py").write(Merge pull request #3247 from pallets/join-stringsDavid Lordbefore adoptiond4b688b
line 66why, one step back66 "import flask\napp = flask.Flask(__name__)\n"Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 67why, one step back67 )Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 68why, one step back68 purge_module("site_app")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 69–71why, one step back6970 from site_app import app71Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 72why, one step back72 assert app.instance_path == modules_tmpdir.join("var").join("site_app-instance")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 73why, one step back73Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 74–78why, one step back7475def test_installed_package_paths(76 limit_loader, modules_tmpdir, modules_tmpdir_prefix, purge_module, monkeypatch77):78 installed_path = modules_tmpdir.mkdir("path")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 79–80why, one step back79 monkeypatch.syspath_prepend(installed_path)80Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 81–84why, one step back81 app = installed_path.mkdir("installed_package")82 init = app.join("__init__.py")83 init.write("import flask\napp = flask.Flask(__name__)")84 purge_module("installed_package")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 85–87why, one step back8586 from installed_package import app87Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 88–90why, one step back88 assert app.instance_path == modules_tmpdir.join("var").join(89 "installed_package-instance"90 )Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 91–92why, one step back9192Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 93–100why, one step back93def test_prefix_package_paths(94 limit_loader, modules_tmpdir, modules_tmpdir_prefix, purge_module, site_packages95):96 app = site_packages.mkdir("site_package")97 init = app.join("__init__.py")98 init.write("import flask\napp = flask.Flask(__name__)")99 purge_module("site_package")100Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 101–102why, one step back101 import site_package102Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 103–105why, one step back103 assert site_package.app.instance_path == modules_tmpdir.join("var").join(104 "site_package-instance"105 )Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 106why, one step back106Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 107–110why, one step back107108def test_egg_installed_paths(install_egg, modules_tmpdir, modules_tmpdir_prefix):109 modules_tmpdir.mkdir("site_egg").join("__init__.py").write(110 "import flask\n\napp = flask.Flask(__name__)"Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 111why, one step back111 )Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 112why, one step back112 install_egg("site_egg")Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
lines 113–114why, one step back113 try:114 import site_eggMerge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 115–118why, one step back115116 assert site_egg.app.instance_path == str(117 modules_tmpdir.join("var/").join("site_egg-instance")118 )Merge pull request #2994 from jarek/werkzeug-640-exceptions-during-bindDavid Lordbefore adoptionca23b7b
line 119why, one step back119 finally:Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
lines 120–121why, one step back120 if "site_egg" in sys.modules:121 del sys.modules["site_egg"]