Gentoo Archives: gentoo-commits

From: Anna Vyalkova <cyber+gentoo@×××××.in>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/doubles/
Date: Sun, 17 Oct 2021 16:24:56
Message-Id: 1634487842.79b550de634ced71240b255a6b1a918a86e7e145.cybertailor@gentoo
1 commit: 79b550de634ced71240b255a6b1a918a86e7e145
2 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Sun Oct 17 16:20:41 2021 +0000
4 Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
5 CommitDate: Sun Oct 17 16:24:02 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=79b550de
7
8 dev-python/doubles: add docs and tests
9
10 Disable pypy3 because it fails too many tests.
11
12 Closes: https://bugs.gentoo.org/816600
13 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
14
15 dev-python/doubles/doubles-1.5.3.ebuild | 57 ++++++++++++++++++++++++++-------
16 dev-python/doubles/metadata.xml | 2 +-
17 2 files changed, 47 insertions(+), 12 deletions(-)
18
19 diff --git a/dev-python/doubles/doubles-1.5.3.ebuild b/dev-python/doubles/doubles-1.5.3.ebuild
20 index ec9295606..debde427e 100644
21 --- a/dev-python/doubles/doubles-1.5.3.ebuild
22 +++ b/dev-python/doubles/doubles-1.5.3.ebuild
23 @@ -3,26 +3,61 @@
24
25 EAPI=8
26
27 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
28 +PYTHON_COMPAT=( python3_{8..10} )
29
30 inherit distutils-r1
31
32 DESCRIPTION="Test doubles for Python"
33 HOMEPAGE="https://github.com/uber/doubles"
34 -SRC_URI="https://github.com/uber/doubles/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
35 +SRC_URI="https://github.com/uber/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
36
37 SLOT="0"
38 LICENSE="MIT"
39 KEYWORDS="~amd64"
40
41 -RDEPEND="
42 - dev-python/six[${PYTHON_USEDEP}]
43 -"
44 -DEPEND="
45 - ${RDEPEND}
46 - test? (
47 - dev-python/nose[${PYTHON_USEDEP}]
48 - )
49 -"
50 +RDEPEND="dev-python/six[${PYTHON_USEDEP}]"
51 +BDEPEND="test? ( dev-python/nose )"
52
53 +DOCS=( CHANGES.rst CONTRIBUTING.rst README.rst )
54 +
55 +distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
56 distutils_enable_tests pytest
57 +
58 +EPYTEST_DESELECT=(
59 + test/allow_test.py::TestTwice::test_fails_when_called_three_times
60 + test/allow_test.py::TestOnce::test_fails_when_called_two_times
61 + test/allow_test.py::TestZeroTimes::test_fails_when_called_once_times
62 + test/allow_test.py::TestExactly::test_called_with_zero
63 + test/allow_test.py::TestExactly::test_fails_when_called_more_than_expected_times
64 + test/allow_test.py::TestAtMost::test_fails_when_called_more_than_at_most_times
65 + test/class_double_test.py::TestClassDouble::test_raises_when_stubbing_instance_methods
66 + test/expect_test.py::TestExpect::test_with_args_validator_not_called
67 + test/expect_test.py::TestExpect::test_raises_if_an_expected_method_call_without_args_is_not_made
68 + test/expect_test.py::TestExpect::test_raises_if_an_expected_method_call_with_args_is_not_made
69 + test/expect_test.py::TestExpect::test_raises_if_an_expected_method_call_with_default_args_is_not_made
70 + test/expect_test.py::TestTwice::test_fails_when_called_once
71 + test/expect_test.py::TestTwice::test_fails_when_called_three_times
72 + test/expect_test.py::TestOnce::test_fails_when_called_two_times
73 + test/expect_test.py::TestExactly::test_fails_when_called_less_than_expected_times
74 + test/expect_test.py::TestExactly::test_fails_when_called_more_than_expected_times
75 + test/expect_test.py::TestAtLeast::test_fails_when_called_less_than_at_least_times
76 + test/expect_test.py::TestAtMost::test_fails_when_called_more_than_at_most_times
77 + test/expect_test.py::Test__call__::test_unsatisfied_expectation
78 + test/expect_test.py::Test__enter__::test_unsatisfied_expectation
79 + test/expect_test.py::Test__exit__::test_unsatisfied_expectation
80 + test/object_double_test.py::TestObjectDouble::test_raises_when_stubbing_nonexistent_methods
81 + test/object_double_test.py::TestObjectDouble::test_raises_when_stubbing_noncallable_attributes
82 + test/pytest_test.py
83 +)
84 +
85 +python_prepare() {
86 + # attempts to import "coverage"
87 + echo "pytest_plugins = ['doubles.pytest_plugin']" > test/conftest.py || die
88 +
89 + # "Distribution information not found. Run 'setup.py develop'"
90 + sed "s/pkg_resources.get_distribution.*/'${PV}'/" -i docs/source/conf.py || die
91 +}
92 +
93 +python_test() {
94 + epytest -p no:doubles test
95 +}
96
97 diff --git a/dev-python/doubles/metadata.xml b/dev-python/doubles/metadata.xml
98 index fd81770d2..29562d9e2 100644
99 --- a/dev-python/doubles/metadata.xml
100 +++ b/dev-python/doubles/metadata.xml
101 @@ -1,5 +1,5 @@
102 <?xml version="1.0" encoding="UTF-8"?>
103 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
104 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
105 <pkgmetadata>
106 <maintainer type="person">
107 <email>lssndrbarbieri@×××××.com</email>