forked from orbit-oss/flask
adding in try around __import__ to catch invalid files/paths (#1950)
This commit is contained in:
parent
e6d7a43ccd
commit
0f1cf50f97
2 changed files with 9 additions and 1 deletions
|
|
@ -80,6 +80,8 @@ def test_locate_app(test_apps):
|
|||
assert locate_app("cliapp.app").name == "testapp"
|
||||
assert locate_app("cliapp.app:testapp").name == "testapp"
|
||||
assert locate_app("cliapp.multiapp:app1").name == "app1"
|
||||
pytest.raises(NoAppException, locate_app, "notanpp.py")
|
||||
pytest.raises(NoAppException, locate_app, "cliapp/app")
|
||||
pytest.raises(RuntimeError, locate_app, "cliapp.app:notanapp")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue