Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 179a4d9

Browse files
gricey432underyx
authored andcommitted
README: Stop recommending a wrapper around MockRedis (underyx#36)
MockRedis supports `from_url` as of 2016 April.
1 parent 8e8a6e1 commit 179a4d9

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

README.rst

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)