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
94
94
95
95
or maybe you want to use
96
96
`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.
100
98
101
99
.. code-block :: python
102
100
@@ -106,17 +104,10 @@ our own.
106
104
from mockredis import MockRedis
107
105
108
106
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
-
116
107
def create_app ():
117
108
app = Flask(__name__ )
118
109
if app.testing:
119
- redis_store = FlaskRedis.from_custom_provider(MockRedisWrapper )
110
+ redis_store = FlaskRedis.from_custom_provider(MockRedis )
120
111
else :
121
112
redis_store = FlaskRedis()
122
113
redis_store.init_app(app)
You can’t perform that action at this time.
0 commit comments