Skip to content

Commit 391dc54

Browse files
authored
Add comment on why realpath is needed
1 parent 59e6fb9 commit 391dc54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/_pytest/config/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ def _getconftestmodules(self, path):
408408
continue
409409
conftestpath = parent.join("conftest.py")
410410
if conftestpath.isfile():
411+
# Use realpath to avoid loading the same conftest twice
412+
# with build systems that create build directories containing
413+
# symlinks to actual files.
411414
mod = self._importconftest(conftestpath.realpath())
412415
clist.append(mod)
413416
self._dirpath2confmods[directory] = clist

0 commit comments

Comments
 (0)