Home / Function/ test_template_loader_debugging() — flask Function Reference

test_template_loader_debugging() — flask Function Reference

Architecture documentation for the test_template_loader_debugging() function in test_templating.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  e466847f_1bc8_e48a_8e04_30ca25d0948c["test_template_loader_debugging()"]
  b3595fee_7041_96b0_f59f_4080381c7deb["test_templating.py"]
  e466847f_1bc8_e48a_8e04_30ca25d0948c -->|defined in| b3595fee_7041_96b0_f59f_4080381c7deb
  587a7c9c_937c_fc25_93be_ccb450351bc5["handle()"]
  e466847f_1bc8_e48a_8e04_30ca25d0948c -->|calls| 587a7c9c_937c_fc25_93be_ccb450351bc5
  style e466847f_1bc8_e48a_8e04_30ca25d0948c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_templating.py lines 488–521

def test_template_loader_debugging(test_apps, monkeypatch):
    from blueprintapp import app

    called = []

    class _TestHandler(logging.Handler):
        def handle(self, record):
            called.append(True)
            text = str(record.msg)
            assert "1: trying loader of application 'blueprintapp'" in text
            assert (
                "2: trying loader of blueprint 'admin' (blueprintapp.apps.admin)"
            ) in text
            assert (
                "trying loader of blueprint 'frontend' (blueprintapp.apps.frontend)"
            ) in text
            assert "Error: the template could not be found" in text
            assert (
                "looked up from an endpoint that belongs to the blueprint 'frontend'"
            ) in text
            assert "See https://flask.palletsprojects.com/blueprints/#templates" in text

    with app.test_client() as c:
        monkeypatch.setitem(app.config, "EXPLAIN_TEMPLATE_LOADING", True)
        monkeypatch.setattr(
            logging.getLogger("blueprintapp"), "handlers", [_TestHandler()]
        )

        with pytest.raises(TemplateNotFound) as excinfo:
            c.get("/missing")

        assert "missing_template.html" in str(excinfo.value)

    assert len(called) == 1

Subdomains

Calls

Frequently Asked Questions

What does test_template_loader_debugging() do?
test_template_loader_debugging() is a function in the flask codebase, defined in tests/test_templating.py.
Where is test_template_loader_debugging() defined?
test_template_loader_debugging() is defined in tests/test_templating.py at line 488.
What does test_template_loader_debugging() call?
test_template_loader_debugging() calls 1 function(s): handle.

Analyze Your Own Codebase

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

Try Supermodel Free