public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pulp-cli] rawhide: Remove subtest workaround
@ 2026-06-08 15:08 Matthias Dellweg
  0 siblings, 0 replies; only message in thread
From: Matthias Dellweg @ 2026-06-08 15:08 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/pulp-cli
            Branch : rawhide
            Commit : 5c597d21ca43349d98f4c2630cb5bf754b3cf3d7
            Author : Matthias Dellweg <x9c4@redhat.com>
            Date   : 2026-06-08T15:08:25+00:00
            Stats  : +0/-103 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/pulp-cli/c/5c597d21ca43349d98f4c2630cb5bf754b3cf3d7?branch=rawhide

            Log:
            Remove subtest workaround

It was cherry-picked from this upstream version anyway.

---
diff --git a/fix-pytest9-remove-subtests.patch b/fix-pytest9-remove-subtests.patch
deleted file mode 100644
index 119894f..0000000
--- a/fix-pytest9-remove-subtests.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From f15c10294e65cadd78cd753dc7cea974e481adc3 Mon Sep 17 00:00:00 2001
-From: Matthias Dellweg <mdellweg@redhat.com>
-Date: Mon, 13 Apr 2026 15:02:40 +0200
-Subject: [PATCH] Stop using subtests
-
-Made-with: Cursor
----
- test_requirements.txt    |  1 -
- tests/test_help_pages.py | 43 ++++++++++++++++++++++------------------
- 2 files changed, 24 insertions(+), 20 deletions(-)
-
-diff --git a/test_requirements.txt b/test_requirements.txt
-index 392abb9..7ee0ca6 100644
---- a/test_requirements.txt
-+++ b/test_requirements.txt
-@@ -1,6 +1,5 @@
- # Test requirements
- pytest>=7.0.0,<9.1
--pytest-subtests>=0.12.0,<0.16
- python-gnupg>=0.5.0,<0.6
- trustme>=1.1.0,<1.3
- jinja2>=3.1.4,<3.2
-diff --git a/tests/test_help_pages.py b/tests/test_help_pages.py
-index 5ca7a58..370f0aa 100644
---- a/tests/test_help_pages.py
-+++ b/tests/test_help_pages.py
-@@ -4,7 +4,6 @@ from functools import reduce
- import click
- import pytest
- from click.testing import CliRunner
--from pytest_subtests.plugin import SubTests
- 
- from pulp_cli import load_plugins, main
- 
-@@ -30,6 +29,12 @@ def traverse_commands(command: click.Command, args: t.List[str]) -> t.Iterator[t
-                         yield from traverse_commands(sub, args + ["--type", context_type, name])
- 
- 
-+def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
-+    m = next(metafunc.definition.iter_markers("help_page"), None)
-+    if m is not None and "base_cmd" in m.kwargs:
-+        metafunc.parametrize("args", traverse_commands(main, m.kwargs["base_cmd"]), ids=" ".join)
-+
-+
- @pytest.fixture
- def no_api(monkeypatch: pytest.MonkeyPatch) -> None:
-     @property  # type: ignore
-@@ -39,30 +44,30 @@ def no_api(monkeypatch: pytest.MonkeyPatch) -> None:
-     monkeypatch.setattr("pulp_glue.common.context.PulpContext.api", getter)
- 
- 
--@pytest.mark.help_page
--def test_access_help(no_api: None, subtests: SubTests) -> None:
--    """Test, that all help screens are accessible without touching the api property."""
-+@pytest.mark.help_page(base_cmd=[])
-+def test_accessing_the_help_page_does_not_invoke_api(
-+    no_api: None,
-+    args: list[str],
-+) -> None:
-     runner = CliRunner()
--    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
--                    or "not available in this context" in result.stderr
--                )
--            else:
--                assert result.exit_code == 0
--                assert result.stdout.startswith("Usage:") or result.stdout.startswith(
--                    "DeprecationWarning:"
--                )
-+    result = runner.invoke(main, args + ["--help"], catch_exceptions=False)
-+
-+    if result.exit_code == 2:
-+        assert (
-+            "not available in this context" in result.stdout
-+            or "not available in this context" in result.stderr
-+        )
-+    else:
-+        assert result.exit_code == 0
-+        assert result.stdout.startswith("Usage:") or result.stdout.startswith(
-+            "DeprecationWarning:"
-+        )
- 
- 
- @pytest.mark.parametrize(
-     "command,options",
-     [
--        (
-+        pytest.param(
-             [
-                 "file",
-                 "repository",
--- 
-2.53.0
-

diff --git a/pulp-cli.spec b/pulp-cli.spec
index 8a02102..9b6903c 100644
--- a/pulp-cli.spec
+++ b/pulp-cli.spec
@@ -15,10 +15,6 @@ BuildArch: noarch
 
 Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
 
-# Remove pytest-subtests dependency and replace with pytest parametrize
-# https://github.com/pulp/pulp-cli/commit/7b4a185
-Patch: fix-pytest9-remove-subtests.patch
-
 BuildRequires: python3-devel
 
 Recommends: pulp-cli-deb

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-08 15:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 15:08 [rpms/pulp-cli] rawhide: Remove subtest workaround Matthias Dellweg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox