File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,7 @@ or perhaps you want to use the old, plain ``Redis`` class instead of
9494
9595 or maybe you want to use
9696`mockredis <https://github.com/locationlabs/mockredis >`_ to make your unit
97- tests simpler. As of ``mockredis `` 2.9.0.10, it does not have the
98- ``from_url() `` classmethod that ``FlaskRedis `` depends on, so we wrap it and add
99- our own.
97+ tests simpler.
10098
10199.. code-block :: python
102100
@@ -106,17 +104,10 @@ our own.
106104 from mockredis import MockRedis
107105
108106
109-
110- class MockRedisWrapper (MockRedis ):
111- ''' A wrapper to add the `from_url` classmethod'''
112- @ classmethod
113- def from_url (cls , * args , ** kwargs ):
114- return cls ()
115-
116107 def create_app ():
117108 app = Flask(__name__ )
118109 if app.testing:
119- redis_store = FlaskRedis.from_custom_provider(MockRedisWrapper )
110+ redis_store = FlaskRedis.from_custom_provider(MockRedis )
120111 else :
121112 redis_store = FlaskRedis()
122113 redis_store.init_app(app)
You can’t perform that action at this time.
0 commit comments