mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/pytest-console-scripts: Fix tests on first install
Closes: https://bugs.gentoo.org/833969 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -25,3 +25,16 @@ BDEPEND="
|
||||
"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_test() {
|
||||
local script="${BUILD_DIR}/install${EPREFIX}/usr/bin/pytest"
|
||||
cat > "${script}" <<-EOF
|
||||
#!/usr/bin/env python
|
||||
import pytest
|
||||
import sys
|
||||
sys.exit(pytest.console_main())
|
||||
EOF
|
||||
chmod +x "${script}" || die
|
||||
epytest -x
|
||||
rm "${script}" || die
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user