prevent NoAppException when ImportError occurs within imported module
This commit is contained in:
parent
789715adb9
commit
0832e77b14
3 changed files with 18 additions and 4 deletions
7
tests/test_apps/cliapp/importerrorapp.py
Normal file
7
tests/test_apps/cliapp/importerrorapp.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from __future__ import absolute_import, print_function
|
||||
|
||||
from flask import Flask
|
||||
|
||||
raise ImportError()
|
||||
|
||||
testapp = Flask('testapp')
|
||||
|
|
@ -83,6 +83,7 @@ def test_locate_app(test_apps):
|
|||
pytest.raises(NoAppException, locate_app, "notanpp.py")
|
||||
pytest.raises(NoAppException, locate_app, "cliapp/app")
|
||||
pytest.raises(RuntimeError, locate_app, "cliapp.app:notanapp")
|
||||
pytest.raises(ImportError, locate_app, "cliapp.importerrorapp")
|
||||
|
||||
|
||||
def test_find_default_import_path(test_apps, monkeypatch, tmpdir):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue