[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
b803a7fd73
commit
5b583ec505
1 changed files with 9 additions and 5 deletions
|
|
@ -30,6 +30,7 @@ from flask.cli import with_appcontext
|
||||||
cwd = Path.cwd()
|
cwd = Path.cwd()
|
||||||
test_path = (Path(__file__) / ".." / "test_apps").resolve()
|
test_path = (Path(__file__) / ".." / "test_apps").resolve()
|
||||||
|
|
||||||
|
|
||||||
# resuable setup and teardown logic for tests
|
# resuable setup and teardown logic for tests
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def runner():
|
def runner():
|
||||||
|
|
@ -40,13 +41,16 @@ def runner():
|
||||||
def test_cli_name(test_apps):
|
def test_cli_name(test_apps):
|
||||||
"""Make sure the CLI object's name is the app's name and not the app itself"""
|
"""Make sure the CLI object's name is the app's name and not the app itself"""
|
||||||
from cliapp.app import testapp
|
from cliapp.app import testapp
|
||||||
|
|
||||||
# name assigned by CLI object within testapp module is equal to name attribute of testapp module itself
|
# name assigned by CLI object within testapp module is equal to name attribute of testapp module itself
|
||||||
assert testapp.cli.name == testapp.name
|
assert testapp.cli.name == testapp.name
|
||||||
|
|
||||||
|
|
||||||
# ensure function behaves as expected in different scenarios
|
# ensure function behaves as expected in different scenarios
|
||||||
def test_find_best_app(test_apps):
|
def test_find_best_app(test_apps):
|
||||||
class Module:
|
class Module:
|
||||||
app = Flask("appname")
|
app = Flask("appname")
|
||||||
|
|
||||||
# find_best_app function takes module as an argument, looks for Flask application objects within that module and applies criteria to determine the best application object before returning that best object
|
# find_best_app function takes module as an argument, looks for Flask application objects within that module and applies criteria to determine the best application object before returning that best object
|
||||||
assert find_best_app(Module) == Module.app
|
assert find_best_app(Module) == Module.app
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue