Dotted name and parts.
(self, invocation_path: Path)
| 152 | resolve_collection_argument(invocation_path, "src/pkg::foo::bar") |
| 153 | |
| 154 | def test_pypath(self, invocation_path: Path) -> None: |
| 155 | """Dotted name and parts.""" |
| 156 | assert resolve_collection_argument( |
| 157 | invocation_path, "pkg.test", as_pypath=True |
| 158 | ) == (invocation_path / "src/pkg/test.py", []) |
| 159 | assert resolve_collection_argument( |
| 160 | invocation_path, "pkg.test::foo::bar", as_pypath=True |
| 161 | ) == (invocation_path / "src/pkg/test.py", ["foo", "bar"]) |
| 162 | assert resolve_collection_argument(invocation_path, "pkg", as_pypath=True) == ( |
| 163 | invocation_path / "src/pkg", |
| 164 | [], |
| 165 | ) |
| 166 | |
| 167 | with pytest.raises( |
| 168 | UsageError, match=r"package argument cannot contain :: selection parts" |
| 169 | ): |
| 170 | resolve_collection_argument( |
| 171 | invocation_path, "pkg::foo::bar", as_pypath=True |
| 172 | ) |
| 173 | |
| 174 | def test_does_not_exist(self, invocation_path: Path) -> None: |
| 175 | """Given a file/module that does not exist raises UsageError.""" |
nothing calls this directly
no test coverage detected