mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: add denylist for db engines (#21486)
This commit is contained in:
committed by
GitHub
parent
aef6217a80
commit
f58227a912
@@ -21,6 +21,7 @@ import os
|
||||
from typing import Any, Callable, Iterator
|
||||
|
||||
import pytest
|
||||
from _pytest.fixtures import SubRequest
|
||||
from pytest_mock import MockFixture
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
@@ -68,7 +69,7 @@ def session(get_session) -> Iterator[Session]:
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def app() -> Iterator[SupersetApp]:
|
||||
def app(request: SubRequest) -> Iterator[SupersetApp]:
|
||||
"""
|
||||
A fixture that generates a Superset app.
|
||||
"""
|
||||
@@ -82,6 +83,11 @@ def app() -> Iterator[SupersetApp]:
|
||||
app.config["PREVENT_UNSAFE_DB_CONNECTIONS"] = False
|
||||
app.config["TESTING"] = True
|
||||
|
||||
# loop over extra configs passed in by tests
|
||||
if request and hasattr(request, "param"):
|
||||
for key, val in request.param.items():
|
||||
app.config[key] = val
|
||||
|
||||
# ``superset.extensions.appbuilder`` is a singleton, and won't rebuild the
|
||||
# routes when this fixture is called multiple times; we need to clear the
|
||||
# registered views to ensure the initialization can happen more than once.
|
||||
|
||||
Reference in New Issue
Block a user