'Creates a mock patch for _is_valid_directory on a Linter to always
return true. This avoids nested patch calls.
Arguments:
linter_class: The linter class to be patched'

def patch_is_valid_directory(self, linter_class):

    patcher = mock.patch.object(linter_class, '_is_valid_directory', return_value=True)
    patch_start = patcher.start()
    self.addCleanup(patcher.stop)
    return patch_start
