Use samefile instead == to compare to SRC_DIR
This resolves a behavioral different between Python 3.7 and 3.8+, where
a == comparison would incorrectly compare Path against str and cause
incorrect results.
@@ -324,7 +324,7 @@ def scoped_global_tempdir_manager(request: pytest.FixtureRequest) -> Iterator[No
def pip_src(tmpdir_factory: pytest.TempPathFactory) -> Path:
def not_code_files_and_folders(path: str, names: List[str]) -> Iterable[str]:
# In the root directory...
- if path == SRC_DIR:
+ if os.path.samefile(path, SRC_DIR):
# ignore all folders except "src"
folders = {
name for name in names if os.path.isdir(os.path.join(path, name))
