Skip to content

Commit

Permalink
Handle close for older versions of redis-py
Browse files Browse the repository at this point in the history
  • Loading branch information
bmerry committed Jul 7, 2020
1 parent 440bc17 commit d25a3a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/test_fakeredis.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def r(request, create_redis):
yield r
if connected:
r.flushall()
r.close()
if hasattr(r, 'close'):
r.close() # Older versions of redis-py don't have this method


def test_large_command(r):
Expand Down

0 comments on commit d25a3a8

Please sign in to comment.