MCPcopy
hub / github.com/redis/redis-py / test_context_manager

Method test_context_manager

tests/test_pubsub.py:1031–1038  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

1029 assert self.message == self.make_message("smessage", self.channel, new_data)
1030
1031 def test_context_manager(self, r):
1032 with r.pubsub() as pubsub:
1033 pubsub.subscribe("foo")
1034 assert pubsub.connection is not None
1035
1036 assert pubsub.connection is None
1037 assert pubsub.channels == {}
1038 assert pubsub.patterns == {}
1039
1040
1041class TestPubSubRedisDown:

Callers

nothing calls this directly

Calls 2

pubsubMethod · 0.45
subscribeMethod · 0.45

Tested by

no test coverage detected