mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
dev-python/pyopenssl: Skip broken test with 32-bit time_t
Closes: https://bugs.gentoo.org/771636 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -6,7 +6,7 @@ EAPI=7
|
||||
PYTHON_COMPAT=( python3_{7..9} pypy3 )
|
||||
PYTHON_REQ_USE="threads(+)"
|
||||
|
||||
inherit distutils-r1 flag-o-matic
|
||||
inherit distutils-r1 flag-o-matic toolchain-funcs
|
||||
|
||||
MY_PN=pyOpenSSL
|
||||
MY_P=${MY_PN}-${PV}
|
||||
@@ -39,13 +39,28 @@ distutils_enable_sphinx doc \
|
||||
dev-python/sphinx_rtd_theme
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_prepare_all() {
|
||||
# Requires network access
|
||||
sed -i -e 's/test_set_default_verify_paths/_&/' tests/test_ssl.py || die
|
||||
distutils-r1_python_prepare_all
|
||||
src_configure() {
|
||||
# test for 32-bit time_t
|
||||
"$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null <<-EOF &>/dev/null
|
||||
#include <sys/types.h>
|
||||
int test[sizeof(time_t) >= 8 ? 1 : -1];
|
||||
EOF
|
||||
if [[ ${?} -eq 0 ]]; then
|
||||
PYOPENSSL_SKIP_LARGE_TIME=
|
||||
einfo "time_t is at least 64-bit long"
|
||||
else
|
||||
PYOPENSSL_SKIP_LARGE_TIME=1
|
||||
einfo "time_t is smaller than 64 bits, will skip broken tests"
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
python_test() {
|
||||
local -x TZ=UTC
|
||||
distutils-r1_src_test
|
||||
local deselect=(
|
||||
tests/test_ssl.py::TestContext::test_set_default_verify_paths
|
||||
)
|
||||
[[ ${PYOPENSSL_SKIP_LARGE_TIME} ]] && deselect+=(
|
||||
tests/test_crypto.py::TestX509StoreContext::test_verify_with_time
|
||||
)
|
||||
epytest ${deselect[@]/#/--deselect }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user