Changed error message for filename too long

This commit is contained in:
Robert O'Shea 2022-07-30 21:50:47 +01:00
parent 64fc3212ba
commit cad8e14c59
1 changed files with 2 additions and 1 deletions

View File

@ -532,10 +532,11 @@ class PytestPluginManager(PluginManager):
if anchor.exists(): # we found some file object if anchor.exists(): # we found some file object
self._try_load_conftest(anchor, namespace.importmode, rootpath) self._try_load_conftest(anchor, namespace.importmode, rootpath)
foundanchor = True foundanchor = True
print(str(anchor))
except OSError: except OSError:
import pytest import pytest
raise pytest.UsageError(f"file or directory not found: {anchor}") raise pytest.UsageError(f"filename is too long: {anchor}")
if not foundanchor: if not foundanchor:
self._try_load_conftest(current, namespace.importmode, rootpath) self._try_load_conftest(current, namespace.importmode, rootpath)