https://github.com/pytest-dev/pytest/blob/053fc118b7af3b77c42daddd6ceacd13394cf64a/_pytest/main.py#L173 Should be ? if not bindir.is_dir(): ..