summaryrefslogtreecommitdiff
path: root/dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-07-11 12:25:19 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-07-11 12:25:19 +0100
commit496ef6155c315ac3628b472dc9b4146fa2684286 (patch)
treea0201d7a6c3a6e30410307544281465381970f4b /dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild
parente810ac4a0e6af9f763f4433863042b34609075a7 (diff)
gentoo auto-resync : 11:07:2024 - 12:25:19
Diffstat (limited to 'dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild')
-rw-r--r--dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild62
1 files changed, 62 insertions, 0 deletions
diff --git a/dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild b/dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild
new file mode 100644
index 000000000000..7eb7eb429338
--- /dev/null
+++ b/dev-python/pytest-twisted/pytest-twisted-1.14.2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit distutils-r1
+
+DESCRIPTION="A pytest plugin for testing Twisted framework consumers"
+HOMEPAGE="
+ https://github.com/pytest-dev/pytest-twisted/
+ https://pypi.org/project/pytest-twisted/
+"
+SRC_URI="
+ https://github.com/pytest-dev/pytest-twisted/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+
+RDEPEND="
+ dev-python/decorator[${PYTHON_USEDEP}]
+ dev-python/greenlet[${PYTHON_USEDEP}]
+ >=dev-python/pytest-2.3[${PYTHON_USEDEP}]
+ dev-python/twisted[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ # If we let pytest-twisted autoload everywhere, it breaks tests in
+ # packages that don't expect it. Apply a similar hack as for bug
+ # #661218.
+ sed -e 's/"pytest11": \[[^]]*\]//' -i setup.py || die
+
+ # https://github.com/pytest-dev/pytest/issues/9280
+ sed -e '/^pytest_plugins =/d' -i testing/conftest.py || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local -x PYTEST_PLUGINS=pytest_twisted
+
+ local EPYTEST_DESELECT=(
+ # regression with pytest-8.2
+ # https://github.com/pytest-dev/pytest-twisted/issues/176
+ testing/test_basic.py::test_async_fixture_module_scope
+ )
+
+ epytest -p pytester
+}