MCPcopy
hub / github.com/pytest-dev/pytest / test_dir

Method test_dir

testing/test_main.py:169–189  ·  view source on GitHub ↗

Directory and parts.

(self, invocation_path: Path)

Source from the content-addressed store, hash-verified

167 )
168
169 def test_dir(self, invocation_path: Path) -> None:
170 """Directory and parts."""
171 assert resolve_collection_argument(
172 invocation_path, "src/pkg", 0
173 ) == CollectionArgument(
174 path=invocation_path / "src/pkg",
175 parts=[],
176 parametrization=None,
177 module_name=None,
178 original_index=0,
179 )
180
181 with pytest.raises(
182 UsageError, match=r"directory argument cannot contain :: selection parts"
183 ):
184 resolve_collection_argument(invocation_path, "src/pkg::", 0)
185
186 with pytest.raises(
187 UsageError, match=r"directory argument cannot contain :: selection parts"
188 ):
189 resolve_collection_argument(invocation_path, "src/pkg::foo::bar", 0)
190
191 @pytest.mark.parametrize("namespace_package", [False, True])
192 def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None:

Callers

nothing calls this directly

Calls 2

CollectionArgumentClass · 0.90

Tested by

no test coverage detected