commit:     78cbdd4a820c1da7cfcef0755eaf32a4d85b3ae9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  8 16:35:18 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar  8 16:35:18 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78cbdd4a

dev-python/anyioutils: Support testing without dev-python/trio

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/anyioutils/anyioutils-0.7.1.ebuild | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/dev-python/anyioutils/anyioutils-0.7.1.ebuild 
b/dev-python/anyioutils/anyioutils-0.7.1.ebuild
index 1fa0866183c5..618c543b9792 100644
--- a/dev-python/anyioutils/anyioutils-0.7.1.ebuild
+++ b/dev-python/anyioutils/anyioutils-0.7.1.ebuild
@@ -17,6 +17,7 @@ HOMEPAGE="
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64"
+IUSE="test-rust"
 
 RDEPEND="
        <dev-python/anyio-5[${PYTHON_USEDEP}]
@@ -29,7 +30,9 @@ RDEPEND="
 "
 BDEPEND="
        test? (
-               dev-python/trio[${PYTHON_USEDEP}]
+               test-rust? (
+                       dev-python/trio[${PYTHON_USEDEP}]
+               )
        )
 "
 
@@ -40,7 +43,14 @@ python_test() {
                # requires aioguest
                tests/test_guest.py::test_host_trivial_guest_asyncio
        )
+       local EPYTEST_IGNORE=()
+
+       local args=()
+       if ! has_version "dev-python/trio[${PYTHON_USEDEP}]"; then
+               EPYTEST_IGNORE+=( tests/test_guest.py )
+               args+=( -k "not trio" )
+       fi
 
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
-       epytest -p anyio
+       epytest -p anyio "${args[@]}"
 }

Reply via email to