This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is a fork of “fakeredis“ that supports Python 3.3 and doesn’t break with “rq“. When the fixes are merged to the main repository, this package will be removed.

fakeredis: A fake version of a redis-py

fakeredis is a pure python implementation of the redis-py python client that simulates talking to a redis server. This was created for a single purpose: to write unittests. Setting up redis is not hard, but many times you want to write unittests that do not talk to an external server (such as redis). This module now allows tests to simply use this module as a reasonable substitute for redis.

How to Use

The intent is for fakeredis to act as though you’re talking to a real redis server. It does this by storing state in the fakeredis module. For example:

>>> import fakeredis
>>> r = fakeredis.FakeStrictRedis()
>>> r.set('foo', 'bar')
>>> r.get('foo')
>>> r.lpush('bar', 1)
>>> r.lpush('bar', 2)
>>> r.lrange('bar', 0, -1)
[2, 1]

By storing state in the fakeredis module, instances can share data:

>>> import fakeredis
>>> r1 = fakeredis.FakeStrictRedis()
>>> r1.set('foo', 'bar')
>>> r2 = fakeredis.FakeStrictRedis()
>>> r2.get('foo')
>>> r2.set('bar', 'baz')
>>> r1.get('bar')
>>> r2.get('bar')

Fakeredis implements the same interface as redis-py, the popular redis client for python, and models the responses of redis 2.6.

Unimplemented Commands

All of the redis commands are implemented in fakeredis with these exceptions:


  • hincrbyfloat


  • incrbyfloat
  • bitop
  • psetex


  • restore
  • dump
  • pexpireat
  • pttl
  • pexpire
  • migrate
  • object


  • debug object
  • client list
  • lastsave
  • slowlog
  • sync
  • shutdown
  • monitor
  • client kill
  • config resetstat
  • time
  • config get
  • save
  • debug segfault
  • bgsave
  • bgrewriteaof
  • slaveof
  • info
  • config set
  • dbsize


  • echo
  • select
  • quit
  • auth


  • script flush
  • script kill
  • script load
  • evalsha
  • eval
  • script exists


  • punsubscribe
  • subscribe
  • publish
  • psubscribe
  • unsubscribe


Contributions are welcome. Please see the contributing guide for more details.

Running the Tests

To ensure parity with the real redis, there are a set of integration tests that mirror the unittests. For every unittest that is written, the same test is run against a real redis instance using a real redis-py client instance. In order to run these tests you must have a redis server running on localhost, port 6379 (the default settings). The integration tests use db=10 in order to minimize collisions with an existing redis instance.

To run all the tests, install the requirements file:

pip install -r requirements.txt

If you just want to run the unittests:


Because this module is attempting to provide the same interface as redis-py, the python bindings to redis, a reasonable way to test this to to take each unittest and run it against a real redis server. fakeredis and the real redis server should give the same result. This ensures parity between the two. You can run these “integration” tests like this:


In terms of implementation, TestRealRedis is a subclass of TestFakeRedis that overrides a factory method to create an instance of redis.Redis (an actual python client for redis) instead of fakeredis.FakeStrictRedis.

To run both the unittests and the “integration” tests, run:


If redis is not running and you try to run tests against a real redis server, these tests will have a result of ‘S’ for skipped.

There are some tests that test redis blocking operations that are somewhat slow. If you want to skip these tests during day to day development, they have all been tagged as ‘slow’ so you can skip them by running:

nosetests -a '!slow'
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fakeredis-fix-0.4.1.tar.gz (13.3 kB) Copy SHA256 Checksum SHA256 Source Feb 3, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting