test_db.py — flask Source File
Architecture documentation for test_db.py, a python file in the flask codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 5fbc7fc1_d1e4_ea0b_c168_f334eb0d86e6["test_db.py"] b8cab999_537d_0433_b3a2_91d5b3c5a7d7["sqlite3"] 5fbc7fc1_d1e4_ea0b_c168_f334eb0d86e6 --> b8cab999_537d_0433_b3a2_91d5b3c5a7d7 da94d511_b8b8_a450_f67f_fc28ea9b648a["pytest"] 5fbc7fc1_d1e4_ea0b_c168_f334eb0d86e6 --> da94d511_b8b8_a450_f67f_fc28ea9b648a 2908b311_ad9c_2dc9_c8a1_842d263dcf86["flaskr.db"] 5fbc7fc1_d1e4_ea0b_c168_f334eb0d86e6 --> 2908b311_ad9c_2dc9_c8a1_842d263dcf86 style 5fbc7fc1_d1e4_ea0b_c168_f334eb0d86e6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import sqlite3
import pytest
from flaskr.db import get_db
def test_get_close_db(app):
with app.app_context():
db = get_db()
assert db is get_db()
with pytest.raises(sqlite3.ProgrammingError) as e:
db.execute("SELECT 1")
assert "closed" in str(e.value)
def test_init_db_command(runner, monkeypatch):
class Recorder:
called = False
def fake_init_db():
Recorder.called = True
monkeypatch.setattr("flaskr.db.init_db", fake_init_db)
result = runner.invoke(args=["init-db"])
assert "Initialized" in result.output
assert Recorder.called
Domain
Subdomains
Classes
Dependencies
- flaskr.db
- pytest
- sqlite3
Source
Frequently Asked Questions
What does test_db.py do?
test_db.py is a source file in the flask codebase, written in python. It belongs to the ApplicationCore domain, ExtensionRegistry subdomain.
What functions are defined in test_db.py?
test_db.py defines 2 function(s): test_get_close_db, test_init_db_command.
What does test_db.py depend on?
test_db.py imports 3 module(s): flaskr.db, pytest, sqlite3.
Where is test_db.py in the architecture?
test_db.py is located at examples/tutorial/tests/test_db.py (domain: ApplicationCore, subdomain: ExtensionRegistry, directory: examples/tutorial/tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free