summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-11-24 19:41:40 +0100
committerMichał Górny <mgorny@gentoo.org>2023-11-24 19:46:39 +0100
commit6095715d85ffde3a9ff983716032aedf0ad2be96 (patch)
treee942eea2e3b0e26d48663c06d128fa9a867b8ef0 /dev-python/click-help-colors
parentdev-python/pytest-mpl: Keyword 0.16.1 arm64, #918015 (diff)
downloadgentoo-6095715d85ffde3a9ff983716032aedf0ad2be96.tar.gz
gentoo-6095715d85ffde3a9ff983716032aedf0ad2be96.tar.bz2
gentoo-6095715d85ffde3a9ff983716032aedf0ad2be96.zip
dev-python/click-help-colors: Fix testing with NO_COLOR
Closes: https://bugs.gentoo.org/906698 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/click-help-colors')
-rw-r--r--dev-python/click-help-colors/click-help-colors-0.9.4.ebuild6
-rw-r--r--dev-python/click-help-colors/files/click-help-colors-0.9.4-no-color.patch14
2 files changed, 20 insertions, 0 deletions
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)