Beispiel #1
0
def _is_pytest_test_file(path: LocalPath, parent):
    """Return `True` if *path* is considered to be a pytest test file."""
    # Based on _pytest/python.py::pytest_collect_file
    fn_patterns = parent.config.getini("python_files") + ["__init__.py"]
    return path.ext == ".py" and (parent.session.isinitpath(path) or any(
        path.fnmatch(pat) for pat in fn_patterns))