Skip to content

Commit 3ead4c1

Browse files
committed
Fix test_access_help to not depend on the subtests fixture
1 parent ca1e833 commit 3ead4c1

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

tests/test_help_pages.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,25 @@ def getter(self: t.Any) -> None:
3939

4040

4141
@pytest.mark.help_page
42-
def test_access_help(no_api: None, subtests: pytest.Subtests) -> None:
42+
def test_access_help(no_api: None) -> None:
4343
"""Test, that all help screens are accessible without touching the api property."""
4444
if parse_version(PULP_CLI_VERSION) < parse_version("0.24"):
4545
pytest.skip("This test is incompatible with older cli versions.")
4646

4747
runner = CliRunner()
48+
failures: t.List[str] = []
4849
for args in traverse_commands(main.commands["workflow"], ["workflow"]):
49-
with subtests.test(msg=" ".join(args)):
50-
result = runner.invoke(main, args + ["--help"], catch_exceptions=False)
51-
52-
if result.exit_code == 2:
53-
assert (
54-
"not available in this context" in result.stdout
55-
or "not available in this context" in result.stderr
56-
)
57-
else:
58-
assert result.exit_code == 0
59-
assert result.stdout.startswith("Usage:") or result.stdout.startswith(
60-
"DeprecationWarning:"
61-
)
50+
result = runner.invoke(main, args + ["--help"], catch_exceptions=False)
51+
52+
if result.exit_code == 2:
53+
if (
54+
"not available in this context" not in result.stdout
55+
and "not available in this context" not in result.stderr
56+
):
57+
failures.append(" ".join(args))
58+
elif result.exit_code != 0 or not (
59+
result.stdout.startswith("Usage:") or result.stdout.startswith("DeprecationWarning:")
60+
):
61+
failures.append(" ".join(args))
62+
63+
assert not failures, "Help screens failed for: " + ", ".join(failures)

0 commit comments

Comments
 (0)