Files
superset2/tests/unit_tests/initialization_test.py
Elizabeth Thompson 5ae1bf4dd2 fix: scope pkg_resources warning filters and add regression coverage
Per richardfogaca's review: the unconditional filters matched only the
warning message, so they suppressed the same setuptools pkg_resources
warning from any dependency, not just sqlalchemy-redshift. Scopes each
filter with category=UserWarning and module=sqlalchemy_redshift(?:\..*)?
across all four registration points (db_engine_specs/redshift.py,
initialization/__init__.py, mcp_service/__init__.py and server.py).

Adds a regression test proving SupersetAppInitializer.configure_logging()
installs the filter before LOGGING_CONFIGURATOR.configure_logging()
dispatches, and tightens the existing mcp_service assertion to check the
new category/module scoping.

The server.py registration is intentionally kept (not removed as
suggested) with a comment explaining why: pytest's warnings plugin
resets warnings.filters around every test, and the existing
test_suppress_third_party_warnings test fails without this line if
removed, proving the reset scenario is real.
2026-07-26 18:57:49 +00:00

23 KiB