Skip to content

Commit

Permalink
chore: use util test env for init check (#23325)
Browse files Browse the repository at this point in the history
  • Loading branch information
eschutho committed Mar 13, 2023
1 parent 29e36b4 commit e42c2a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/superset-python-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
mkdir ${{ github.workspace }}/.temp
- name: Python unit tests
if: steps.check.outcome == 'failure'
env:
SUPERSET_TESTENV: true
run: |
pytest --durations-min=0.5 --cov-report= --cov=superset ./tests/common ./tests/unit_tests --cache-clear
- name: Upload code coverage
Expand Down
5 changes: 2 additions & 3 deletions superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from superset.security import SupersetSecurityManager
from superset.superset_typing import FlaskResponse
from superset.tags.core import register_sqla_event_listeners
from superset.utils.core import pessimistic_connection_handling
from superset.utils.core import is_test, pessimistic_connection_handling
from superset.utils.log import DBEventLogger, get_event_logger_from_cfg_value

if TYPE_CHECKING:
Expand Down Expand Up @@ -457,8 +457,7 @@ def log_default_secret_key_warning() -> None:
if (
self.superset_app.debug
or self.superset_app.config["TESTING"]
# There must be a better way
or "pytest" in sys.modules
or is_test()
):
logger.warning("Debug mode identified with default secret key")
log_default_secret_key_warning()
Expand Down

0 comments on commit e42c2a7

Please sign in to comment.