summaryrefslogtreecommitdiff
path: root/dev-python/pytest-env
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-24 21:52:33 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-24 21:52:33 +0100
commit27ddeb821d437a2d848d9fa85a30f88f48fb52a6 (patch)
treeff7929a09cd2ebf0d87cf6970bfa9168dc4bcb07 /dev-python/pytest-env
parentc7a2fa9581ac6df998adac5277043bb8014861fb (diff)
gentoo auto-resync : 24:08:2023 - 21:52:33
Diffstat (limited to 'dev-python/pytest-env')
-rw-r--r--dev-python/pytest-env/Manifest3
-rw-r--r--dev-python/pytest-env/files/pytest-env-1.0.0-test.patch36
-rw-r--r--dev-python/pytest-env/pytest-env-1.0.0.ebuild30
3 files changed, 63 insertions, 6 deletions
diff --git a/dev-python/pytest-env/Manifest b/dev-python/pytest-env/Manifest
index afdcc1bc1d59..0797b5dde5e1 100644
--- a/dev-python/pytest-env/Manifest
+++ b/dev-python/pytest-env/Manifest
@@ -1,5 +1,6 @@
+AUX pytest-env-1.0.0-test.patch 1451 BLAKE2B 5b02309ecd24b7d3bb86d7fcccac7f26ba50fcd19be2936a79e21ebfb3533fbc94277d9dd88e9bedbc26ef5e9b7269d721ebff2b5f79238850d0c432b1b43f0b SHA512 37f03df47da05495c6cf87efb0f3c417db0b0fbd3e98dfb6b9a3d9b9f8ac305e8cb72c57293ed0b48021f278652aed0a7418f2e8952942f4b24ffcf7891b6dd9
DIST pytest_env-0.8.2.tar.gz 7419 BLAKE2B c07140de76392bcf316935efaa52aea344c7167a95fe497c3702dd2aabc3150641f0903f2de6ee1794453dc2e5b1630d746b2fcb3dbcea8edb9ba066cde0a0b4 SHA512 6fbbb6b1db21ebeb47c472e10adb9bacedcdbbabceeaf93b01146ec7e175005aeef46616a4343bf02b23561c0ff5815506fe356f337371dfc057ee29521f68af
DIST pytest_env-1.0.0.tar.gz 7456 BLAKE2B 9eaf71aa05a9a4b8783184dce1f1779b5ee54da54839f1113c9276df7cb4c4ef6055aadad7d20063d4c5c24654f2d100970bdae540eac49b89f049b78be49e93 SHA512 9d25c704e253c11e77933911817ba2b42127c13c38615e1cbf11575cfced81c69a46603bef680ee371512788acb6359a76841019837d55151490fd1f093bb83b
EBUILD pytest-env-0.8.2.ebuild 596 BLAKE2B 6ddb1a4c070f8bffd30bde98ad2eb56072e6ca50797bc2558a46e565a477d4561f02ce174a816dce9c37fd57f7ab3b232720c93b9477be1506de577c2e952971 SHA512 c551c81c948311199ed0180bf570e357b0d80e55de9b76bc678680873b7d683680d9aefe74f13a14ed03626dd2eb037fbd20a4e3603bd45132eb8106a9f91265
-EBUILD pytest-env-1.0.0.ebuild 598 BLAKE2B d6b23aceac1d5602cf7a521c3847ddb30a01ab1ed536e1250be12b00b91030935fcf48e0f909adea3e5b028d65a25f6c660a63372b17eb711631e7cf54467b2f SHA512 ce52506b1841072eb1b16eb86a88216959343f120d8f0144532efb51bba8318de37f96cdd9d5467915c82f095e3fda85247d83ed01c51a1eb1acbfe477300b8c
+EBUILD pytest-env-1.0.0.ebuild 816 BLAKE2B 29d794a05078bb6f7444f0648f55e6b6203103e53026415f772a6871ede4613d9da84ac074324315ee21bdf62474bb9d19e84585e19b36c6669844e45d3f0986 SHA512 54c2d37c7aa4aaeed7fadda1e0e2cadde67b683dc652017f3f97feb4c05abca2c56aa9a7b5f77b75df9349e14f83cc745d2045054996564994d47e54052fd75e
MISC metadata.xml 505 BLAKE2B 00369d63ea894a5d1b493461b41f5a211219dba4aee1e53a5bfcd4e37fb181ebb7f4934e721c186a5d631f3f03a8bbea2b1d732a1206b2347beb71b03f0c84a0 SHA512 78e7bf0e52d709686f0302ee3ffb2d11ff85860586a42aa23e974f60bf675de919d9d78fa0aa80d66b779b1575936686bf2846830ef4bea25e4ed87d2ce05835
diff --git a/dev-python/pytest-env/files/pytest-env-1.0.0-test.patch b/dev-python/pytest-env/files/pytest-env-1.0.0-test.patch
new file mode 100644
index 000000000000..c86815ebc3a2
--- /dev/null
+++ b/dev-python/pytest-env/files/pytest-env-1.0.0-test.patch
@@ -0,0 +1,36 @@
+From 4227409be9a2ca287f227e50fbf4c38ca237b676 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 24 Aug 2023 06:38:30 +0200
+Subject: [PATCH] Disable plugin autoloading in the test suite
+
+Disable plugin autoloading in the test suite to prevent other installed
+plugins from interfering with the test results. This is particularly
+important since tests are run with cleared environment that could break
+other plugins (e.g. pytest-xvfb is broken by the lack of PATH).
+
+Fixes #48
+---
+ tests/test_env.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_env.py b/tests/test_env.py
+index 16cd080..a409b60 100644
+--- a/tests/test_env.py
++++ b/tests/test_env.py
+@@ -104,8 +104,15 @@ def test_env(
+ Path(str(tmp_dir / f"test_{test_name}.py")).symlink_to(Path(__file__).parent / "template.py")
+ (tmp_dir / "pytest.ini").write_text(ini, encoding="utf-8")
+
++ new_env = {
++ **env,
++ "_TEST_ENV": repr(expected_env),
++ "PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1",
++ "PYTEST_PLUGINS": "pytest_env.plugin",
++ }
++
+ # monkeypatch persists env variables across parametrized tests, therefore using mock.patch.dict
+- with mock.patch.dict(os.environ, {**env, "_TEST_ENV": repr(expected_env)}, clear=True):
++ with mock.patch.dict(os.environ, new_env, clear=True):
+ result = testdir.runpytest()
+
+ result.assert_outcomes(passed=1)
diff --git a/dev-python/pytest-env/pytest-env-1.0.0.ebuild b/dev-python/pytest-env/pytest-env-1.0.0.ebuild
index db479a2c1572..8f228d09367e 100644
--- a/dev-python/pytest-env/pytest-env-1.0.0.ebuild
+++ b/dev-python/pytest-env/pytest-env-1.0.0.ebuild
@@ -5,17 +5,37 @@ EAPI=8
DISTUTILS_USE_PEP517=hatchling
PYTHON_COMPAT=( python3_{10..12} )
+
inherit distutils-r1 pypi
-DESCRIPTION="py.test plugin that allows you to add environment variables"
-HOMEPAGE="https://github.com/pytest-dev/pytest-env"
+DESCRIPTION="pytest plugin that allows you to add environment variables"
+HOMEPAGE="
+ https://github.com/pytest-dev/pytest-env/
+ https://pypi.org/project/pytest-env/
+"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~x86"
-RDEPEND="dev-python/pytest[${PYTHON_USEDEP}]"
-BDEPEND=">=dev-python/hatch-vcs-0.3[${PYTHON_USEDEP}]
- test? ( >=dev-python/pytest-mock-3.10.0[${PYTHON_USEDEP}] )"
+RDEPEND="
+ dev-python/pytest[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ >=dev-python/hatch-vcs-0.3[${PYTHON_USEDEP}]
+ test? (
+ >=dev-python/pytest-mock-3.10.0[${PYTHON_USEDEP}]
+ )
+"
distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/pytest-dev/pytest-env/pull/49
+ "${FILESDIR}/${P}-test.patch"
+)
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}