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:
|
if i != -1:
|
||||||
path = path[:i]
|
path = path[:i]
|
||||||
anchor = absolutepath(current / path)
|
anchor = absolutepath(current / path)
|
||||||
if anchor.exists(): # we found some file object
|
try:
|
||||||
self._try_load_conftest(anchor, namespace.importmode, rootpath)
|
if anchor.exists(): # we found some file object
|
||||||
foundanchor = True
|
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:
|
if not foundanchor:
|
||||||
self._try_load_conftest(current, namespace.importmode, rootpath)
|
self._try_load_conftest(current, namespace.importmode, rootpath)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue