Skip to content
redis module unit tests with python (deprecated) please see RLTest
Python C
Branch: master
Clone or download
mnunberg Merge pull request #10 from ashtul/master
test initialization arguments
Latest commit 4fb86bf Sep 8, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci build: small tweaks to output format for circleci Sep 5, 2018
rmtest oops Sep 8, 2019
.gitignore added and fixed conf names Nov 21, 2017
LICENSE Setup CircleCI for rmtest builds, using python3 Sep 4, 2018
module.c Added unit test and testing module May 10, 2017
redismodule.h Added unit test and testing module May 10, 2017
requirements.txt build: add back latest redis module install in circleci Sep 5, 2018 package: stable 1.0 release for all python versions Sep 11, 2018 pylint: update all the rmtest code to be pylint clean Sep 5, 2018


A simple nano-framework for testing redis modules using python unit test, and a disposable ephemeral redis subprocess.



import unittest
from rmtest import ModuleTestCase

class MyTestCase(ModuleTestCase('../', module_args = ('foo', 'bar'))):
    def testCmd(self):
        self.assertOk(self.cmd('mymodule.dosomething', 'foo', 'bar'))

if __name__ == '__main__':

Controlling parameters with Environment Variables

It is possible to control the path to the redis server executable, the path to the module and an optional fixed port, from environment variables.


Controls the path to the module, either absolute, or relative to where the test resides.


Controls the path to redis-server. By default we assume it's in $PATH


Causes the tests to run against a fixed redis port instead of spawning ephemeral disposable redis instances for each test.

This is useful for debugging failures with redis-cli MONITOR.


Causes the tests to be run under a debugger (e.g. valgrind). The value to this environment variable is the path to the debugger. Does not work if there are spaces in the path.

Installing from pypi

$ pip install rmtest

Installing from Git

  1. Clone this repo

  2. sudo python install

You can’t perform that action at this time.