SIGN IN SIGN UP
apache / superset UNCLAIMED

Apache Superset is a Data Visualization and Data Exploration Platform

0 0 150 TypeScript

fix(mcp): use explicit patch for security_manager mock in test_create_dataset_access_denied

The test was getting 'ValidationError' instead of 'AccessDeniedError' because
setting side_effect on mock_sec from the autouse fixture was not reliably
triggering during the async tool invocation. Refactor to use an explicit
patch(_SEC_PATH) context manager with side_effect pre-configured inside the
test body, ensuring security_manager.raise_for_access raises
SupersetSecurityException as expected.

The autouse mock_dao_and_security fixture still handles the DAO mock (database
found). The inner patch overrides only the security manager mock with the
raise_for_access side_effect set before the tool is called.

Also fix pre-existing ruff PT001/PT023 issues (add parentheses to @pytest.fixture
and @pytest.mark.asyncio decorators) that were auto-fixed by ruff --fix.
A
Amin Ghadersohi committed
caa3d975f677328cac7ef818283ce2b775f742b0
Parent: 4685d88