File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,7 @@ def _getconftestmodules(self, path):
380
380
if self ._noconftest :
381
381
return []
382
382
383
+ path = path .realpath ()
383
384
if path .isfile ():
384
385
directory = path .dirpath ()
385
386
else :
Original file line number Diff line number Diff line change @@ -192,8 +192,10 @@ def pytest_addoption(parser):
192
192
)
193
193
def test_conftest_symlink (testdir ):
194
194
"""Ensure that conftest.py is used for resolved symlinks."""
195
- realtests = testdir .tmpdir .mkdir ("real" ).mkdir ("app" ).mkdir ("tests" )
195
+ real = testdir .tmpdir .mkdir ("real" )
196
+ realtests = real .mkdir ("app" ).mkdir ("tests" )
196
197
testdir .tmpdir .join ("symlinktests" ).mksymlinkto (realtests )
198
+ testdir .tmpdir .join ("symlink" ).mksymlinkto (real )
197
199
testdir .makepyfile (
198
200
** {
199
201
"real/app/tests/test_foo.py" : "def test1(fixture): pass" ,
@@ -220,6 +222,10 @@ def fixture():
220
222
)
221
223
assert result .ret == EXIT_OK
222
224
225
+ # Should not cause "ValueError: Plugin already registered" (#4174).
226
+ result = testdir .runpytest ("-vs" , "symlink" )
227
+ assert result .ret == EXIT_OK
228
+
223
229
realtests .ensure ("__init__.py" )
224
230
result = testdir .runpytest ("-vs" , "symlinktests/test_foo.py::test1" )
225
231
result .stdout .fnmatch_lines (
You can’t perform that action at this time.
0 commit comments