|
7 | 7 | """ |
8 | 8 |
|
9 | 9 | import pathlib |
10 | | -import runpy |
11 | | -import sys |
12 | 10 | import typing |
13 | 11 |
|
14 | 12 | import pytest |
15 | 13 | import yaml |
16 | 14 |
|
17 | | -from tests._descriptor_gate import DescriptorGateError, main, validate |
| 15 | +from tests._descriptor_gate import DescriptorGateError, validate |
18 | 16 |
|
19 | 17 |
|
20 | 18 | _REPO_ROOT: typing.Final = pathlib.Path(__file__).parent.parent |
@@ -123,24 +121,3 @@ def test_unpinned_semvertag_fails(tmp_path: pathlib.Path, shipped_descriptor_doc |
123 | 121 | bad = _write_descriptor(tmp_path, [spec, body]) |
124 | 122 | with pytest.raises(DescriptorGateError, match=r"script.* must pin the semvertag version"): |
125 | 123 | validate(str(bad)) |
126 | | - |
127 | | - |
128 | | -def test_main_prints_shape_ok_for_valid_descriptor(capsys: pytest.CaptureFixture[str]) -> None: |
129 | | - main(["_descriptor_gate", str(_DESCRIPTOR_PATH)]) |
130 | | - captured: typing.Final = capsys.readouterr() |
131 | | - assert captured.out == f"{_DESCRIPTOR_PATH} shape OK\n" |
132 | | - |
133 | | - |
134 | | -def test_module_run_as_script_validates_argv_path( |
135 | | - monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str] |
136 | | -) -> None: |
137 | | - monkeypatch.setattr(sys, "argv", ["_descriptor_gate", str(_DESCRIPTOR_PATH)]) |
138 | | - monkeypatch.delitem(sys.modules, "tests._descriptor_gate") |
139 | | - runpy.run_module("tests._descriptor_gate", run_name="__main__") |
140 | | - captured: typing.Final = capsys.readouterr() |
141 | | - assert captured.out == f"{_DESCRIPTOR_PATH} shape OK\n" |
142 | | - |
143 | | - |
144 | | -def test_main_raises_when_argv_length_wrong() -> None: |
145 | | - with pytest.raises(DescriptorGateError, match=r"usage: python -m tests\._descriptor_gate"): |
146 | | - main(["_descriptor_gate"]) |
0 commit comments