style cleanup

[ci skip]
This commit is contained in:
David Lord 2017-06-16 06:59:37 -07:00
parent 0b80acb25c
commit 448368e226
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 35 additions and 21 deletions

View file

@ -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'