summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-11-27 10:14:35 +0100
committerMichał Górny <mgorny@gentoo.org>2021-11-27 11:27:25 +0100
commit944316073dbbd1d080c53273768af01db20d498a (patch)
tree779c5d842461c6ed05f5179ec0e641b8e95193c6 /dev-python/pypiserver
parentdev-python/pip: Skip cryptography tests when not available (diff)
downloadgentoo-944316073dbbd1d080c53273768af01db20d498a.tar.gz
gentoo-944316073dbbd1d080c53273768af01db20d498a.tar.bz2
gentoo-944316073dbbd1d080c53273768af01db20d498a.zip
dev-python/pypiserver: Support running tests without twine
Deselect the few tests requiring twine if it is not installed. This is in preparation for cryptography versions requiring Rust causing twine to lose keywords. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pypiserver')
-rw-r--r--dev-python/pypiserver/pypiserver-1.4.2.ebuild31
1 files changed, 19 insertions, 12 deletions
diff --git a/dev-python/pypiserver/pypiserver-1.4.2.ebuild b/dev-python/pypiserver/pypiserver-1.4.2.ebuild
index d33d2bc3bcf9..18a622a294c3 100644
--- a/dev-python/pypiserver/pypiserver-1.4.2.ebuild
+++ b/dev-python/pypiserver/pypiserver-1.4.2.ebuild
@@ -32,16 +32,23 @@ DOCS=( README.rst )
distutils_enable_tests pytest
-src_prepare() {
- sed -i -e "/tox/d" setup.py || die
-
- # https://github.com/pypiserver/pypiserver/issues/312
- sed -e 's:test_root_count:_&:' \
- -i tests/test_app.py || die
- sed -e 's:test_hash_algos:_&:' \
- -e 's:test_pipInstall_openOk:_&:' \
- -e 's:test_pipInstall_authedOk:_&:' \
- -i tests/test_server.py || die
-
- distutils-r1_src_prepare
+python_test() {
+ local EPYTEST_DESELECT=(
+ # Internet
+ tests/test_server.py::test_hash_algos
+ tests/test_server.py::test_pipInstall_openOk
+ tests/test_server.py::test_pipInstall_authedOk
+ )
+
+ if ! has_version "dev-python/twine[${PYTHON_USEDEP}]"; then
+ EPYTEST_DESELECT+=(
+ tests/test_server.py::test_twine_register_authed_ok
+ tests/test_server.py::test_twine_register_open
+ tests/test_server.py::test_twine_upload_authed
+ tests/test_server.py::test_twine_upload_open
+ tests/test_server.py::test_twine_upload_partial_authed
+ )
+ fi
+
+ epytest
}