Home / Function/ test_find_best_app() — flask Function Reference

test_find_best_app() — flask Function Reference

Architecture documentation for the test_find_best_app() function in test_cli.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  47b4a6fb_0498_12cd_b655_998290850f04["test_find_best_app()"]
  62c63da0_a9c3_ab0a_4c48_a9413eac90e3["test_cli.py"]
  47b4a6fb_0498_12cd_b655_998290850f04 -->|defined in| 62c63da0_a9c3_ab0a_4c48_a9413eac90e3
  870b03e5_c961_237d_d703_442267b4ac04["create_app()"]
  47b4a6fb_0498_12cd_b655_998290850f04 -->|calls| 870b03e5_c961_237d_d703_442267b4ac04
  a0460c44_07b4_fc7c_479a_36792b2b01d1["make_app()"]
  47b4a6fb_0498_12cd_b655_998290850f04 -->|calls| a0460c44_07b4_fc7c_479a_36792b2b01d1
  style 47b4a6fb_0498_12cd_b655_998290850f04 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_cli.py lines 48–132

def test_find_best_app(test_apps):
    class Module:
        app = Flask("appname")

    assert find_best_app(Module) == Module.app

    class Module:
        application = Flask("appname")

    assert find_best_app(Module) == Module.application

    class Module:
        myapp = Flask("appname")

    assert find_best_app(Module) == Module.myapp

    class Module:
        @staticmethod
        def create_app():
            return Flask("appname")

    app = find_best_app(Module)
    assert isinstance(app, Flask)
    assert app.name == "appname"

    class Module:
        @staticmethod
        def create_app(**kwargs):
            return Flask("appname")

    app = find_best_app(Module)
    assert isinstance(app, Flask)
    assert app.name == "appname"

    class Module:
        @staticmethod
        def make_app():
            return Flask("appname")

    app = find_best_app(Module)
    assert isinstance(app, Flask)
    assert app.name == "appname"

    class Module:
        myapp = Flask("appname1")

        @staticmethod
        def create_app():
            return Flask("appname2")

    assert find_best_app(Module) == Module.myapp

    class Module:
        myapp = Flask("appname1")

        @staticmethod
        def create_app():
            return Flask("appname2")

    assert find_best_app(Module) == Module.myapp

    class Module:
        pass

    pytest.raises(NoAppException, find_best_app, Module)

    class Module:
        myapp1 = Flask("appname1")
        myapp2 = Flask("appname2")

    pytest.raises(NoAppException, find_best_app, Module)

    class Module:
        @staticmethod
        def create_app(foo, bar):
            return Flask("appname2")

    pytest.raises(NoAppException, find_best_app, Module)

    class Module:
        @staticmethod

Subdomains

Defined In

Frequently Asked Questions

What does test_find_best_app() do?
test_find_best_app() is a function in the flask codebase, defined in tests/test_cli.py.
Where is test_find_best_app() defined?
test_find_best_app() is defined in tests/test_cli.py at line 48.
What does test_find_best_app() call?
test_find_best_app() calls 2 function(s): create_app, make_app.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free