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

Method test_file

testing/test_main.py:120–135  ·  view source on GitHub ↗

File and parts.

(self, invocation_path: Path)

Source from the content-addressed store, hash-verified

118 return pytester.path
119
120 def test_file(self, invocation_path: Path) -> None:
121 """File and parts."""
122 assert resolve_collection_argument(invocation_path, "src/pkg/test.py") == (
123 invocation_path / "src/pkg/test.py",
124 [],
125 )
126 assert resolve_collection_argument(invocation_path, "src/pkg/test.py::") == (
127 invocation_path / "src/pkg/test.py",
128 [""],
129 )
130 assert resolve_collection_argument(
131 invocation_path, "src/pkg/test.py::foo::bar"
132 ) == (invocation_path / "src/pkg/test.py", ["foo", "bar"])
133 assert resolve_collection_argument(
134 invocation_path, "src/pkg/test.py::foo::bar::"
135 ) == (invocation_path / "src/pkg/test.py", ["foo", "bar", ""])
136
137 def test_dir(self, invocation_path: Path) -> None:
138 """Directory and parts."""

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected