Given a file/module that does not exist raises UsageError.
(self, invocation_path: Path)
| 261 | resolve_collection_argument(invocation_path, arg, 0) |
| 262 | |
| 263 | def test_does_not_exist(self, invocation_path: Path) -> None: |
| 264 | """Given a file/module that does not exist raises UsageError.""" |
| 265 | with pytest.raises( |
| 266 | UsageError, match=re.escape("file or directory not found: foobar") |
| 267 | ): |
| 268 | resolve_collection_argument(invocation_path, "foobar", 0) |
| 269 | |
| 270 | with pytest.raises( |
| 271 | UsageError, |
| 272 | match=re.escape( |
| 273 | "module or package not found: foobar (missing __init__.py?)" |
| 274 | ), |
| 275 | ): |
| 276 | resolve_collection_argument(invocation_path, "foobar", 0, as_pypath=True) |
| 277 | |
| 278 | def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> None: |
| 279 | """Absolute paths resolve back to absolute paths.""" |
nothing calls this directly
no test coverage detected