fixup! WIP
All checks were successful
Run tests / run-tests (push) Successful in 1m21s

This commit is contained in:
2025-12-10 15:42:04 +09:00
parent 90da53c26c
commit 4c14a2cf65

View File

@@ -11,9 +11,9 @@ from dibbler.models import Base
def pytest_addoption(parser):
parser.addoption(
"--echo",
"--debug-sql",
action="store_true",
help="Enable SQLAlchemy echo mode for debugging",
help="Enable SQLAlchemy 'echo' mode for debugging",
)
@@ -37,7 +37,7 @@ class SqlParseFormatter(logging.Formatter):
def pytest_configure(config):
"""Setup pretty SQL logging if --echo is enabled."""
"""Setup pretty SQL logging if --debug-sql is enabled."""
logger = logging.getLogger("sqlalchemy.engine")
@@ -47,8 +47,7 @@ def pytest_configure(config):
handler.setFormatter(SqlParseFormatter())
logger.addHandler(handler)
echo = config.getoption("--echo")
if echo:
if config.getoption("--debug-sql"):
logger.setLevel(logging.INFO)