MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_does_not_exist

Method test_does_not_exist

testing/test_main.py:174–187  ·  view source on GitHub ↗

Given a file/module that does not exist raises UsageError.

(self, invocation_path: Path)

Source from the content-addressed store, hash-verified

172 )
173
174 def test_does_not_exist(self, invocation_path: Path) -> None:
175 """Given a file/module that does not exist raises UsageError."""
176 with pytest.raises(
177 UsageError, match=re.escape("file or directory not found: foobar")
178 ):
179 resolve_collection_argument(invocation_path, "foobar")
180
181 with pytest.raises(
182 UsageError,
183 match=re.escape(
184 "module or package not found: foobar (missing __init__.py?)"
185 ),
186 ):
187 resolve_collection_argument(invocation_path, "foobar", as_pypath=True)
188
189 def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> None:
190 """Absolute paths resolve back to absolute paths."""

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected