Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-console-scripts/
Date: Thu, 24 Feb 2022 11:01:11
Message-Id: 1645700463.32ad24c1352a0fc841fce9f2a5d30fee375386cf.mgorny@gentoo
1 commit: 32ad24c1352a0fc841fce9f2a5d30fee375386cf
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 24 11:00:06 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 24 11:01:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32ad24c1
7
8 dev-python/pytest-console-scripts: Fix tests on first install
9
10 Closes: https://bugs.gentoo.org/833969
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../pytest-console-scripts-1.3.ebuild | 13 +++++++++++++
14 1 file changed, 13 insertions(+)
15
16 diff --git a/dev-python/pytest-console-scripts/pytest-console-scripts-1.3.ebuild b/dev-python/pytest-console-scripts/pytest-console-scripts-1.3.ebuild
17 index ecebac91b445..c63120a98ecc 100644
18 --- a/dev-python/pytest-console-scripts/pytest-console-scripts-1.3.ebuild
19 +++ b/dev-python/pytest-console-scripts/pytest-console-scripts-1.3.ebuild
20 @@ -25,3 +25,16 @@ BDEPEND="
21 "
22
23 distutils_enable_tests pytest
24 +
25 +python_test() {
26 + local script="${BUILD_DIR}/install${EPREFIX}/usr/bin/pytest"
27 + cat > "${script}" <<-EOF
28 + #!/usr/bin/env python
29 + import pytest
30 + import sys
31 + sys.exit(pytest.console_main())
32 + EOF
33 + chmod +x "${script}" || die
34 + epytest -x
35 + rm "${script}" || die
36 +}