'Returns the list of \*.py files (default) from which docstrings
will be tested which are at or below directory ``dir``. By default,
only those that have an __init__.py in their parent directory
and do not start with ``test_`` will be included.'

def get_test_files(self, dir, pat='*.py', init_only=True):

    def importable(x):
        '\n                                                Checks    if    given    pathname    x    is    an    importable    module    by    checking    for\n                                                __init__.py    file.\n\n                                                Returns    True/False.\n\n                                                Currently    we    only    test    if    the    __init__.py    file    exists    in    the\n                                                directory    with    the    file    "x"    (in    theory    we    should    also    test    all    the\n                                                parent    dirs).\n                                                '
        init_py = os.path.join(os.path.dirname(x), '__init__.py')
        return os.path.exists(init_py)
    dir = os.path.join(self._root_dir, convert_to_native_paths([dir])[0])
    g = []
    for (path, folders, files) in os.walk(dir):
        g.extend([os.path.join(path, f) for f in files if ((not f.startswith('test_')) and fnmatch(f, pat))])
    if init_only:
        g = [x for x in g if importable(x)]
    return [sys_normcase(gi) for gi in g]
