From cad8e14c591e9b5294535b32f489d8f336ab7353 Mon Sep 17 00:00:00 2001 From: Robert O'Shea Date: Sat, 30 Jul 2022 21:50:47 +0100 Subject: [PATCH] Changed error message for filename too long --- src/_pytest/config/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index a3ab78503..5f560e00b 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -532,10 +532,11 @@ class PytestPluginManager(PluginManager): if anchor.exists(): # we found some file object self._try_load_conftest(anchor, namespace.importmode, rootpath) foundanchor = True + print(str(anchor)) except OSError: import pytest - raise pytest.UsageError(f"file or directory not found: {anchor}") + raise pytest.UsageError(f"filename is too long: {anchor}") if not foundanchor: self._try_load_conftest(current, namespace.importmode, rootpath)