[ANN] rmtest - a testing library for modules in Python

10 views
Skip to first unread message

Dvir Volk

unread,
Dec 28, 2016, 9:36:38 AM12/28/16
to redis-module-devs
Hey all.

I've opened a small utility library I wrote for testing modules with python. 

You can install it by simply running pip install rmtest

It allows to quickly write tests and run them against your module, using ephemeral disposable redis instances, so you're not depending on redis to be running for the tests to succeed.

here's a simle example:
from rmtest import ModuleTestCase
class MyTestCase(ModuleTestCase('/path/to/module.so')):
    def testCmd(self):
        with self.redis() as r:
            self.assertOk(r.execute_command('mymodule.dosomething', 'foo', 'bar'))

You can also control the path to your module and the redis server executable with env variables.

It extends the default python unittesting framework, so you get all the assertions you are used to, plus a few modules-specific convenience functions.

I hope you'll find it useful. An real-world usage can be found here: 

Simone Mosciatti

unread,
Dec 28, 2016, 1:46:23 PM12/28/16
to redis-module-devs
Thank you :)

Thulio Assis

unread,
Mar 4, 2017, 3:30:45 PM3/4/17
to redis-module-devs
Awesome utility. I am not even by far a python developer, but I was able to write the tests of my module using it! Thank you!
Reply all
Reply to author
Forward
0 new messages