Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions providers/redis/tests/unit/redis/hooks/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
from airflow.models import Connection
from airflow.providers.redis.hooks.redis import RedisHook

pytestmark = pytest.mark.db_test


class TestRedisHook:
@pytest.mark.db_test
def test_get_conn(self):
hook = RedisHook(redis_conn_id="redis_default")
assert hook.redis is None
Expand Down Expand Up @@ -78,6 +77,7 @@ def test_get_conn_with_extra_config(self, mock_get_connection, mock_redis):
ssl_check_hostname=connection.extra_dejson["ssl_check_hostname"],
)

@pytest.mark.db_test
def test_get_conn_password_stays_none(self):
hook = RedisHook(redis_conn_id="redis_default")
hook.get_conn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
from tests_common.test_utils.config import conf_vars
from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS

pytestmark = pytest.mark.db_test


class TestRedisTaskHandler:
@pytest.fixture
Expand Down Expand Up @@ -74,6 +72,7 @@ def ti(self):
with create_session() as session:
session.query(DagRun).delete()

@pytest.mark.db_test
@conf_vars({("logging", "remote_log_conn_id"): "redis_default"})
def test_write(self, ti):
handler = RedisTaskHandler("any", max_lines=5, ttl_seconds=2)
Expand All @@ -94,6 +93,7 @@ def test_write(self, ti):
pipeline.return_value.expire.assert_called_once_with(key, time=2)
pipeline.return_value.execute.assert_called_once_with()

@pytest.mark.db_test
@conf_vars({("logging", "remote_log_conn_id"): "redis_default"})
def test_read(self, ti):
handler = RedisTaskHandler("any")
Expand Down