Home / Function/ test_from_prefixed_env() — flask Function Reference

test_from_prefixed_env() — flask Function Reference

Architecture documentation for the test_from_prefixed_env() function in test_config.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  e23c2b97_c3fa_f188_17b6_94079fa68bed["test_from_prefixed_env()"]
  af09ffc0_0dff_d9d9_7274_4611c3d0d0e6["test_config.py"]
  e23c2b97_c3fa_f188_17b6_94079fa68bed -->|defined in| af09ffc0_0dff_d9d9_7274_4611c3d0d0e6
  style e23c2b97_c3fa_f188_17b6_94079fa68bed fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_config.py lines 48–66

def test_from_prefixed_env(monkeypatch):
    monkeypatch.setenv("FLASK_STRING", "value")
    monkeypatch.setenv("FLASK_BOOL", "true")
    monkeypatch.setenv("FLASK_INT", "1")
    monkeypatch.setenv("FLASK_FLOAT", "1.2")
    monkeypatch.setenv("FLASK_LIST", "[1, 2]")
    monkeypatch.setenv("FLASK_DICT", '{"k": "v"}')
    monkeypatch.setenv("NOT_FLASK_OTHER", "other")

    app = flask.Flask(__name__)
    app.config.from_prefixed_env()

    assert app.config["STRING"] == "value"
    assert app.config["BOOL"] is True
    assert app.config["INT"] == 1
    assert app.config["FLOAT"] == 1.2
    assert app.config["LIST"] == [1, 2]
    assert app.config["DICT"] == {"k": "v"}
    assert "OTHER" not in app.config

Subdomains

Frequently Asked Questions

What does test_from_prefixed_env() do?
test_from_prefixed_env() is a function in the flask codebase, defined in tests/test_config.py.
Where is test_from_prefixed_env() defined?
test_from_prefixed_env() is defined in tests/test_config.py at line 48.

Analyze Your Own Codebase

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

Try Supermodel Free