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/pykwalify/, dev-python/pykwalify/files/
Date: Thu, 23 Apr 2020 07:28:23
Message-Id: 1587626888.370797b0043b0cc3f75b353ff738af0e75c68f2b.mgorny@gentoo
1 commit: 370797b0043b0cc3f75b353ff738af0e75c68f2b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 23 07:15:38 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 23 07:28:08 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=370797b0
7
8 dev-python/pykwalify: Fix tests, modernize, py3.8
9
10 Thanks to Marek Szuba for pointing out the patches.
11
12 Closes: https://bugs.gentoo.org/718938
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 .../pykwalify/files/pykwalify-1.7.0-test.patch | 48 ++++++++++++++++++++++
16 dev-python/pykwalify/pykwalify-1.7.0.ebuild | 18 ++++----
17 2 files changed, 55 insertions(+), 11 deletions(-)
18
19 diff --git a/dev-python/pykwalify/files/pykwalify-1.7.0-test.patch b/dev-python/pykwalify/files/pykwalify-1.7.0-test.patch
20 new file mode 100644
21 index 00000000000..a41653abae1
22 --- /dev/null
23 +++ b/dev-python/pykwalify/files/pykwalify-1.7.0-test.patch
24 @@ -0,0 +1,48 @@
25 +From 744816a146e567a4c1efd30e874ff76134754fe2 Mon Sep 17 00:00:00 2001
26 +From: Grokzen <Grokzen@×××××.com>
27 +Date: Wed, 9 Oct 2019 23:25:59 +0200
28 +Subject: [PATCH] Fix broken test where errors data was wrong and duplicated
29 +
30 +---
31 + tests/files/fail/test_type_float.yaml | 2 --
32 + 1 file changed, 2 deletions(-)
33 +
34 +diff --git a/tests/files/fail/test_type_float.yaml b/tests/files/fail/test_type_float.yaml
35 +index bef14b8..972167d 100644
36 +--- a/tests/files/fail/test_type_float.yaml
37 ++++ b/tests/files/fail/test_type_float.yaml
38 +@@ -16,8 +16,6 @@ schema:
39 + type: seq
40 + seq:
41 + - type: float
42 +-errors:
43 +- - "Value 'foo' is not of type 'float'. Path: '/0'"
44 + errors:
45 + - "Value 'True' is not of type 'float'. Path: '/1'"
46 + - "Value 'foo' is not of type 'float'. Path: '/0'"
47 +
48 +From 49052dd010637e1403c8b2b1c3710926acd2b1a0 Mon Sep 17 00:00:00 2001
49 +From: Grokzen <Grokzen@×××××.com>
50 +Date: Wed, 9 Oct 2019 23:21:09 +0200
51 +Subject: [PATCH] Fixed bug in test_multi_file_support where pytest would raise
52 + issue with a option that is no longer supported
53 +
54 +---
55 + tests/test_core.py | 4 +++-
56 + 1 file changed, 3 insertions(+), 1 deletion(-)
57 +
58 +diff --git a/tests/test_core.py b/tests/test_core.py
59 +index 6fcd81e..bd974df 100644
60 +--- a/tests/test_core.py
61 ++++ b/tests/test_core.py
62 +@@ -336,7 +336,9 @@ def test_multi_file_support(self):
63 + compare(c.root_rule.schema_str, passing_test[2], prefix="Parsed rules is not correct, something have changed...")
64 +
65 + for failing_test in failing_tests:
66 +- with pytest.raises(failing_test[2], message="Test files: {0} : {1}".format(", ".join(failing_test[0]), failing_test[1])):
67 ++ print("Test files: {0} : {1}".format(", ".join(failing_test[0]), failing_test[1]))
68 ++
69 ++ with pytest.raises(failing_test[2]):
70 + c = Core(schema_files=failing_test[0], source_file=failing_test[1])
71 + c.validate()
72 +
73
74 diff --git a/dev-python/pykwalify/pykwalify-1.7.0.ebuild b/dev-python/pykwalify/pykwalify-1.7.0.ebuild
75 index c7744c23108..1bd14f74144 100644
76 --- a/dev-python/pykwalify/pykwalify-1.7.0.ebuild
77 +++ b/dev-python/pykwalify/pykwalify-1.7.0.ebuild
78 @@ -3,7 +3,8 @@
79
80 EAPI=7
81
82 -PYTHON_COMPAT=( python3_{6,7} )
83 +DISTUTILS_USE_SETUPTOOLS=rdepend
84 +PYTHON_COMPAT=( python3_{6,7,8} )
85
86 inherit distutils-r1
87
88 @@ -14,26 +15,21 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
89 SLOT="0"
90 LICENSE="MIT"
91 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
92 -IUSE="test"
93 -RESTRICT="!test? ( test )"
94
95 RDEPEND="
96 >=dev-python/docopt-0.6.2[${PYTHON_USEDEP}]
97 >=dev-python/pyyaml-3.11[${PYTHON_USEDEP}]
98 >=dev-python/python-dateutil-2.4.2[${PYTHON_USEDEP}]
99 - dev-python/setuptools[${PYTHON_USEDEP}]
100 "
101 DEPEND="
102 - dev-python/setuptools[${PYTHON_USEDEP}]
103 test? (
104 - ${RDEPEND}
105 - dev-python/pytest[${PYTHON_USEDEP}]
106 dev-python/testfixtures[${PYTHON_USEDEP}]
107 )
108 "
109
110 -PATCHES=( "${FILESDIR}"/${PN}-1.4.0-S.patch )
111 +distutils_enable_tests pytest
112
113 -python_test() {
114 - pytest -vv || die
115 -}
116 +PATCHES=(
117 + "${FILESDIR}"/${PN}-1.4.0-S.patch
118 + "${FILESDIR}"/${P}-test.patch
119 +)