summaryrefslogtreecommitdiff
path: root/dev-python/pytest
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2023-11-25 18:33:43 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2023-11-25 18:33:43 +0000
commitea0f4ccc747e37b64ab9dc7ef92a8fabb7c5b0c5 (patch)
treea2a08f53c54c7fad4ae80451e00faac327ab47ac /dev-python/pytest
parent5e3f5cbdaa0b307a5bbed30104624a723ac81025 (diff)
downloadbaldeagleos-repo-ea0f4ccc747e37b64ab9dc7ef92a8fabb7c5b0c5.tar.gz
baldeagleos-repo-ea0f4ccc747e37b64ab9dc7ef92a8fabb7c5b0c5.tar.xz
baldeagleos-repo-ea0f4ccc747e37b64ab9dc7ef92a8fabb7c5b0c5.zip
Adding metadata
Diffstat (limited to 'dev-python/pytest')
-rw-r--r--dev-python/pytest/files/pytest-7.4.3-no-color.patch37
-rw-r--r--dev-python/pytest/pytest-7.4.3.ebuild7
2 files changed, 43 insertions, 1 deletions
diff --git a/dev-python/pytest/files/pytest-7.4.3-no-color.patch b/dev-python/pytest/files/pytest-7.4.3-no-color.patch
new file mode 100644
index 000000000000..a6fa02472252
--- /dev/null
+++ b/dev-python/pytest/files/pytest-7.4.3-no-color.patch
@@ -0,0 +1,37 @@
+From ce93a8ad7a11d1e9be76ce6af0d510f935622c1f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 25 Nov 2023 12:09:32 +0100
+Subject: [PATCH] Reset color-related envvars for testing
+
+Reset color-related environment variables in a fixture to prevent them
+from affecting test results. Otherwise, some of the tests fail
+e.g. if NO_COLOR is set in the calling environment.
+---
+ testing/conftest.py | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/testing/conftest.py b/testing/conftest.py
+index 2a3ce5203..612777304 100644
+--- a/testing/conftest.py
++++ b/testing/conftest.py
+@@ -30,6 +30,17 @@ def set_column_width(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setenv("COLUMNS", "80")
+
+
++@pytest.fixture(autouse=True)
++def reset_colors(monkeypatch: pytest.MonkeyPatch) -> None:
++ """
++ Reset all color-related variables to prevent them from affecting internal pytest output
++ in tests that depend on it.
++ """
++ monkeypatch.delenv("PY_COLORS", raising=False)
++ monkeypatch.delenv("NO_COLOR", raising=False)
++ monkeypatch.delenv("FORCE_COLOR", raising=False)
++
++
+ @pytest.hookimpl(hookwrapper=True, tryfirst=True)
+ def pytest_collection_modifyitems(items):
+ """Prefer faster tests.
+--
+2.43.0
+
diff --git a/dev-python/pytest/pytest-7.4.3.ebuild b/dev-python/pytest/pytest-7.4.3.ebuild
index 85cf5375cd37..400496236c05 100644
--- a/dev-python/pytest/pytest-7.4.3.ebuild
+++ b/dev-python/pytest/pytest-7.4.3.ebuild
@@ -18,7 +18,7 @@ HOMEPAGE="
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="test"
RESTRICT="!test? ( test )"
@@ -49,6 +49,11 @@ BDEPEND="
)
"
+PATCHES=(
+ # https://github.com/pytest-dev/pytest/pull/11638
+ "${FILESDIR}/${P}-no-color.patch"
+)
+
src_test() {
# workaround new readline defaults
echo "set enable-bracketed-paste off" > "${T}"/inputrc || die