villebro commented on code in PR #29912:
URL: https://github.com/apache/superset/pull/29912#discussion_r1736697593
##########
tests/unit_tests/async_events/async_query_manager_tests.py:
##########
@@ -26,17 +27,27 @@
AsyncQueryManager,
AsyncQueryTokenException,
)
+from superset.async_events.cache_backend import (
+ RedisCacheBackend,
+ RedisSentinelCacheBackend,
+)
JWT_TOKEN_SECRET = "some_secret"
JWT_TOKEN_COOKIE_NAME = "superset_async_jwt"
+# Define the cache backends once as mocks
+cache_backends = {
+ "RedisCacheBackend": mock.Mock(spec=RedisCacheBackend),
+ "RedisSentinelCacheBackend": mock.Mock(spec=RedisSentinelCacheBackend),
+ "redis.Redis": mock.Mock(spec=redis.Redis),
+}
+
Review Comment:
@nsivarajan I believe it's generally suggested to use `pytest_mock` with
`pytest` test cases. I don't want to drag out this review process more than
necessary, but I think the cleanest solution would be one with
`pytest.mark.parametrize` and `pytest_mock`. LMKWYT, but in the meantime let me
re-review the functional parts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]