Home / Function/ test_scriptinfo() — flask Function Reference

test_scriptinfo() — flask Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_cli.py lines 247–286

def test_scriptinfo(test_apps, monkeypatch):
    obj = ScriptInfo(app_import_path="cliapp.app:testapp")
    app = obj.load_app()
    assert app.name == "testapp"
    assert obj.load_app() is app

    # import app with module's absolute path
    cli_app_path = str(test_path / "cliapp" / "app.py")

    obj = ScriptInfo(app_import_path=cli_app_path)
    app = obj.load_app()
    assert app.name == "testapp"
    assert obj.load_app() is app
    obj = ScriptInfo(app_import_path=f"{cli_app_path}:testapp")
    app = obj.load_app()
    assert app.name == "testapp"
    assert obj.load_app() is app

    def create_app():
        return Flask("createapp")

    obj = ScriptInfo(create_app=create_app)
    app = obj.load_app()
    assert app.name == "createapp"
    assert obj.load_app() is app

    obj = ScriptInfo()
    pytest.raises(NoAppException, obj.load_app)

    # import app from wsgi.py in current directory
    monkeypatch.chdir(test_path / "helloworld")
    obj = ScriptInfo()
    app = obj.load_app()
    assert app.name == "hello"

    # import app from app.py in current directory
    monkeypatch.chdir(test_path / "cliapp")
    obj = ScriptInfo()
    app = obj.load_app()
    assert app.name == "testapp"

Subdomains

Defined In

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free