commit:     6095715d85ffde3a9ff983716032aedf0ad2be96
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 24 18:41:40 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 24 18:46:39 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6095715d

dev-python/click-help-colors: Fix testing with NO_COLOR

Closes: https://bugs.gentoo.org/906698
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../click-help-colors/click-help-colors-0.9.4.ebuild       |  6 ++++++
 .../files/click-help-colors-0.9.4-no-color.patch           | 14 ++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/dev-python/click-help-colors/click-help-colors-0.9.4.ebuild 
b/dev-python/click-help-colors/click-help-colors-0.9.4.ebuild
index 1f2d4a2665be..7a8949cd236a 100644
--- a/dev-python/click-help-colors/click-help-colors-0.9.4.ebuild
+++ b/dev-python/click-help-colors/click-help-colors-0.9.4.ebuild
@@ -28,6 +28,12 @@ RDEPEND="
 
 distutils_enable_tests pytest
 
+PATCHES=(
+       # https://github.com/click-contrib/click-help-colors/pull/25
+       # https://github.com/click-contrib/click-help-colors/pull/26
+       "${FILESDIR}/${P}-no-color.patch"
+)
+
 python_install_all() {
        use examples && dodoc -r examples
        distutils-r1_python_install_all

diff --git 
a/dev-python/click-help-colors/files/click-help-colors-0.9.4-no-color.patch 
b/dev-python/click-help-colors/files/click-help-colors-0.9.4-no-color.patch
new file mode 100644
index 000000000000..bc8ca134fb67
--- /dev/null
+++ b/dev-python/click-help-colors/files/click-help-colors-0.9.4-no-color.patch
@@ -0,0 +1,14 @@
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 10482b8..25827a0 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -7,3 +7,9 @@ from click.testing import CliRunner
+ @pytest.fixture
+ def runner():
+     return CliRunner()
++
++
++@pytest.fixture(autouse=True)
++def clean_env(monkeypatch):
++    monkeypatch.delenv("FORCE_COLOR", raising=False)
++    monkeypatch.delenv("NO_COLOR", raising=False)

Reply via email to