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

Method test_parse_from_file

testing/test_parseopt.py:140–145  ·  view source on GitHub ↗
(self, parser: parseopt.Parser, tmp_path: Path)

Source from the content-addressed store, hash-verified

138 # Can be removed once Python<3.12 support is dropped.
139 @pytest.mark.filterwarnings("ignore:'encoding' argument not specified")
140 def test_parse_from_file(self, parser: parseopt.Parser, tmp_path: Path) -> None:
141 tests = [".", "some.py::Test::test_method[param0]", "other/test_file.py"]
142 args_file = tmp_path / "tests.txt"
143 args_file.write_text("\n".join(tests), encoding="utf-8")
144 args = parser.parse([f"@{args_file.absolute()}"])
145 assert getattr(args, parseopt.FILE_OR_DIR) == tests
146
147 def test_parse_known_args(self, parser: parseopt.Parser) -> None:
148 parser.parse_known_args([Path(".")])

Callers

nothing calls this directly

Calls 3

write_textMethod · 0.80
joinMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected