Skip to content
Myr

Merge pull request #2217 from edbrannin/patch-1

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

shorten output when ImportError due to app bug.

authored by David Lord · committed by GitHub · parents 6efea34, 6e5250a · Browse files · 2 files+4 added−2 removed
This commit

State

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

Diff stats

2 files+4 added−2 removed

  • tests:+1 added−1 removed
  • other:+3 added−1 removed

2 files+4 added−2 removed

modified:flask/cli.py+3 added-1 removed
91 unmodified lines
92 except ImportError:93 # Reraise the ImportError if it occurred within the imported module.94 # Determine this by checking whether the trace has a depth > 1.95 if sys.exc_info()[-1].tb_next:96 raise96 stack_trace = traceback.format_exc()97 raise NoAppException('There was an error trying to import'98 ' the app (%s):\n%s' % (module, stack_trace))99 else:100 raise NoAppException('The file/path provided (%s) does not appear'101 ' to exist. Please verify the path is '102 'correct. If app is not on PYTHONPATH, '
427 unmodified lines
modified:tests/test_cli.py+1 added-1 removed
81 unmodified lines
82 assert locate_app("cliapp.multiapp:app1").name == "app1"83 pytest.raises(NoAppException, locate_app, "notanpp.py")84 pytest.raises(NoAppException, locate_app, "cliapp/app")85 pytest.raises(RuntimeError, locate_app, "cliapp.app:notanapp")86 pytest.raises(ImportError, locate_app, "cliapp.importerrorapp")86 pytest.raises(NoAppException, locate_app, "cliapp.importerrorapp")878889def test_find_default_import_path(test_apps, monkeypatch, tmpdir):90 """Test of find_default_import_path."""
120 unmodified lines