use ast to parse FLASK_APP

enables keyword arguments to factory functions
This commit is contained in:
David Lord 2020-04-07 17:54:51 -07:00
parent 0d04b40d13
commit ff2f71379b
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
4 changed files with 67 additions and 40 deletions

View file

@ -203,7 +203,6 @@ def test_prepare_import(request, value, path, result):
("cliapp.factory", None, "app"),
("cliapp.factory", "create_app", "app"),
("cliapp.factory", "create_app()", "app"),
# no script_info
("cliapp.factory", 'create_app2("foo", "bar")', "app2_foo_bar"),
# trailing comma space
("cliapp.factory", 'create_app2("foo", "bar", )', "app2_foo_bar"),