Fixed error when filename too long
This commit is contained in:
parent
b4ab2f0942
commit
7d3a5a821c
|
@ -528,9 +528,14 @@ class PytestPluginManager(PluginManager):
|
|||
if i != -1:
|
||||
path = path[:i]
|
||||
anchor = absolutepath(current / path)
|
||||
try:
|
||||
if anchor.exists(): # we found some file object
|
||||
self._try_load_conftest(anchor, namespace.importmode, rootpath)
|
||||
foundanchor = True
|
||||
except OSError:
|
||||
import pytest
|
||||
|
||||
raise pytest.UsageError(f"file or directory not found: {anchor}")
|
||||
if not foundanchor:
|
||||
self._try_load_conftest(current, namespace.importmode, rootpath)
|
||||
|
||||
|
|
Loading…
Reference in New Issue