class RedisCleanupMixin(object):
    client = None
    prefix = None

    def setUp(self):
        super(RedisCleanupMixin, self).setUp()
        self.assertIsNotNone(self.client, "Need a redis client to be provided")

    def tearDown(self):
        root = '*'
        if self.prefix is not None:
            root = '{}*'.format(self.prefix)

        keys = self.client.keys(root)
        for key in keys:
            self.client.delete(key)

        super(RedisCleanupMixin, self).tearDown()

class RedisCleanupMixin(object):
    client = None
    prefix = NotImplemented  # type: str

    def setUp(self):
        super(RedisCleanupMixin, self).setUp()
        self.assertIsNotNone(self.client, "Need a redis client to be provided")

    def tearDown(self):
        root = '*'
        if self.prefix is not None:
            root = '{}*'.format(self.prefix)

        keys = self.client.keys(root)
        for key in keys:
            self.client.delete(key)

        super(RedisCleanupMixin, self).tearDown()

Add annotation required for mypy
Add annotation required for mypy

  class RedisCleanupMixin(object):
      client = None
-     prefix = None
+     prefix = NotImplemented  # type: str
  
      def setUp(self):
          super(RedisCleanupMixin, self).setUp()
          self.assertIsNotNone(self.client, "Need a redis client to be provided")
  
      def tearDown(self):
          root = '*'
          if self.prefix is not None:
              root = '{}*'.format(self.prefix)
  
          keys = self.client.keys(root)
          for key in keys:
              self.client.delete(key)
  
          super(RedisCleanupMixin, self).tearDown()
  
Add annotation required for mypy
## Code Before:
class RedisCleanupMixin(object):
    client = None
    prefix = None

    def setUp(self):
        super(RedisCleanupMixin, self).setUp()
        self.assertIsNotNone(self.client, "Need a redis client to be provided")

    def tearDown(self):
        root = '*'
        if self.prefix is not None:
            root = '{}*'.format(self.prefix)

        keys = self.client.keys(root)
        for key in keys:
            self.client.delete(key)

        super(RedisCleanupMixin, self).tearDown()

## Instruction:
Add annotation required for mypy
## Code After:
class RedisCleanupMixin(object):
    client = None
    prefix = NotImplemented  # type: str

    def setUp(self):
        super(RedisCleanupMixin, self).setUp()
        self.assertIsNotNone(self.client, "Need a redis client to be provided")

    def tearDown(self):
        root = '*'
        if self.prefix is not None:
            root = '{}*'.format(self.prefix)

        keys = self.client.keys(root)
        for key in keys:
            self.client.delete(key)

        super(RedisCleanupMixin, self).tearDown()
