diff --git a/test_requirements.txt b/test_requirements.txt index f17772b4f..2c28356a3 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -4,6 +4,7 @@ # Test requirements pygments pytest +pytest-subtests python-gnupg # Lint requirements diff --git a/tests/test_help_pages.py b/tests/test_help_pages.py index eec08c35f..450354b8f 100644 --- a/tests/test_help_pages.py +++ b/tests/test_help_pages.py @@ -38,14 +38,17 @@ def getter(self): @pytest.mark.help_page -@pytest.mark.parametrize("args", traverse_commands(main, []), ids=" ".join) -def test_access_help(no_api, args): +def test_access_help(no_api, subtests): """Test, that all help screens are accessible without touching the api property.""" runner = CliRunner() - result = runner.invoke(main, args + ["--help"], catch_exceptions=False) - - if result.exit_code == 2: - assert "not available in this context" in result.stdout - else: - assert result.exit_code == 0 - assert result.stdout.startswith("Usage:") or result.stdout.startswith("DeprecationWarning:") + for args in traverse_commands(main, []): + with subtests.test(msg=" ".join(args)): + result = runner.invoke(main, args + ["--help"], catch_exceptions=False) + + if result.exit_code == 2: + assert "not available in this context" in result.stdout + else: + assert result.exit_code == 0 + assert result.stdout.startswith("Usage:") or result.stdout.startswith( + "DeprecationWarning:" + )