def METHOD_NAME(patch_obj, cls):
    """Apply patch on setup class and remove on teardown class
    A `patch` is normally applied to a class by decorating each of the
    class's methods, which means that the patch is not in place between
    method calls. This applies the patch on `setUpClass` and removes it
    on `tearDownClass`.
    """
    def setUpClass():
        patch_obj.start()
        real_setup()
    def tearDownClass():
        try:
            real_teardown()
        finally:
            patch_obj.stop()
    real_setup = cls.setUpClass
    real_teardown = cls.tearDownClass
    cls.setUpClass = setUpClass
    cls.tearDownClass = tearDownClass
    return cls