improve error message if no apps found in registry (#2585)
This commit is contained in:
@@ -347,7 +347,13 @@ def test_app_registry_retrieval_from_multiple():
|
||||
|
||||
def test_get_app_does_not_exist():
|
||||
with pytest.raises(
|
||||
SanicException, match='Sanic app name "does-not-exist" not found.'
|
||||
SanicException,
|
||||
match="Sanic app name 'does-not-exist' not found.\n"
|
||||
"App instantiation must occur outside "
|
||||
"if __name__ == '__main__' "
|
||||
"block or by using an AppLoader.\nSee "
|
||||
"https://sanic.dev/en/guide/deployment/app-loader.html"
|
||||
" for more details."
|
||||
):
|
||||
Sanic.get_app("does-not-exist")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user