forked from orbit-oss/flask
style cleanup
[ci skip]
This commit is contained in:
parent
0b80acb25c
commit
448368e226
3 changed files with 35 additions and 21 deletions
|
|
@ -181,8 +181,9 @@ def test_locate_app(test_apps):
|
|||
script_info, "cliapp.factory:create_app ()")
|
||||
pytest.raises(
|
||||
NoAppException, locate_app, script_info, "cliapp.importerrorapp")
|
||||
assert locate_app(script_info, "notanpp.py",
|
||||
raise_if_not_found=False) is None
|
||||
assert locate_app(
|
||||
script_info, "notanpp.py", raise_if_not_found=False
|
||||
) is None
|
||||
|
||||
|
||||
def test_find_default_import_path(test_apps, monkeypatch, tmpdir):
|
||||
|
|
@ -231,19 +232,20 @@ def test_scriptinfo(test_apps, monkeypatch):
|
|||
assert obj.load_app() == app
|
||||
|
||||
obj = ScriptInfo()
|
||||
pytest.raises(
|
||||
NoAppException, obj.load_app)
|
||||
pytest.raises(NoAppException, obj.load_app)
|
||||
|
||||
# import app from wsgi.py in current directory
|
||||
monkeypatch.chdir(os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), 'test_apps', 'helloworld')))
|
||||
monkeypatch.chdir(os.path.abspath(os.path.join(
|
||||
os.path.dirname(__file__), 'test_apps', 'helloworld'
|
||||
)))
|
||||
obj = ScriptInfo()
|
||||
app = obj.load_app()
|
||||
assert app.name == 'hello'
|
||||
|
||||
# import app from app.py in current directory
|
||||
monkeypatch.chdir(os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), 'test_apps', 'cliapp')))
|
||||
monkeypatch.chdir(os.path.abspath(os.path.join(
|
||||
os.path.dirname(__file__), 'test_apps', 'cliapp'
|
||||
)))
|
||||
obj = ScriptInfo()
|
||||
app = obj.load_app()
|
||||
assert app.name == 'testapp'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue