Home / Function/ test_with_appcontext() — flask Function Reference

test_with_appcontext() — flask Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  12c00957_0e04_f4db_f1ea_b7356e7deb26["test_with_appcontext()"]
  62c63da0_a9c3_ab0a_4c48_a9413eac90e3["test_cli.py"]
  12c00957_0e04_f4db_f1ea_b7356e7deb26 -->|defined in| 62c63da0_a9c3_ab0a_4c48_a9413eac90e3
  cfcc1ba6_ce20_a6d4_f8cd_998cddafcbac["invoke()"]
  12c00957_0e04_f4db_f1ea_b7356e7deb26 -->|calls| cfcc1ba6_ce20_a6d4_f8cd_998cddafcbac
  style 12c00957_0e04_f4db_f1ea_b7356e7deb26 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_cli.py lines 307–317

def test_with_appcontext(runner):
    @click.command()
    @with_appcontext
    def testcmd():
        click.echo(current_app.name)

    obj = ScriptInfo(create_app=lambda: Flask("testapp"))

    result = runner.invoke(testcmd, obj=obj)
    assert result.exit_code == 0
    assert result.output == "testapp\n"

Subdomains

Defined In

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free