summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-04-23 09:15:38 +0200
committerMichał Górny <mgorny@gentoo.org>2020-04-23 09:28:08 +0200
commit370797b0043b0cc3f75b353ff738af0e75c68f2b (patch)
tree4edca6b4289a6160786cac390e679f985aa8e65c /dev-python/pykwalify
parentpackage.mask: Last rite dev-python/{guessit,rebulk} (diff)
downloadgentoo-370797b0043b0cc3f75b353ff738af0e75c68f2b.tar.gz
gentoo-370797b0043b0cc3f75b353ff738af0e75c68f2b.tar.bz2
gentoo-370797b0043b0cc3f75b353ff738af0e75c68f2b.zip
dev-python/pykwalify: Fix tests, modernize, py3.8
Thanks to Marek Szuba for pointing out the patches. Closes: https://bugs.gentoo.org/718938 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pykwalify')
-rw-r--r--dev-python/pykwalify/files/pykwalify-1.7.0-test.patch48
-rw-r--r--dev-python/pykwalify/pykwalify-1.7.0.ebuild18
2 files changed, 55 insertions, 11 deletions
diff --git a/dev-python/pykwalify/files/pykwalify-1.7.0-test.patch b/dev-python/pykwalify/files/pykwalify-1.7.0-test.patch
new file mode 100644
index 000000000000..a41653abae1b
--- /dev/null
+++ b/dev-python/pykwalify/files/pykwalify-1.7.0-test.patch
@@ -0,0 +1,48 @@
+From 744816a146e567a4c1efd30e874ff76134754fe2 Mon Sep 17 00:00:00 2001
+From: Grokzen <Grokzen@gmail.com>
+Date: Wed, 9 Oct 2019 23:25:59 +0200
+Subject: [PATCH] Fix broken test where errors data was wrong and duplicated
+
+---
+ tests/files/fail/test_type_float.yaml | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/tests/files/fail/test_type_float.yaml b/tests/files/fail/test_type_float.yaml
+index bef14b8..972167d 100644
+--- a/tests/files/fail/test_type_float.yaml
++++ b/tests/files/fail/test_type_float.yaml
+@@ -16,8 +16,6 @@ schema:
+ type: seq
+ seq:
+ - type: float
+-errors:
+- - "Value 'foo' is not of type 'float'. Path: '/0'"
+ errors:
+ - "Value 'True' is not of type 'float'. Path: '/1'"
+ - "Value 'foo' is not of type 'float'. Path: '/0'"
+
+From 49052dd010637e1403c8b2b1c3710926acd2b1a0 Mon Sep 17 00:00:00 2001
+From: Grokzen <Grokzen@gmail.com>
+Date: Wed, 9 Oct 2019 23:21:09 +0200
+Subject: [PATCH] Fixed bug in test_multi_file_support where pytest would raise
+ issue with a option that is no longer supported
+
+---
+ tests/test_core.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_core.py b/tests/test_core.py
+index 6fcd81e..bd974df 100644
+--- a/tests/test_core.py
++++ b/tests/test_core.py
+@@ -336,7 +336,9 @@ def test_multi_file_support(self):
+ compare(c.root_rule.schema_str, passing_test[2], prefix="Parsed rules is not correct, something have changed...")
+
+ for failing_test in failing_tests:
+- with pytest.raises(failing_test[2], message="Test files: {0} : {1}".format(", ".join(failing_test[0]), failing_test[1])):
++ print("Test files: {0} : {1}".format(", ".join(failing_test[0]), failing_test[1]))
++
++ with pytest.raises(failing_test[2]):
+ c = Core(schema_files=failing_test[0], source_file=failing_test[1])
+ c.validate()
+
diff --git a/dev-python/pykwalify/pykwalify-1.7.0.ebuild b/dev-python/pykwalify/pykwalify-1.7.0.ebuild
index c7744c23108c..1bd14f741442 100644
--- a/dev-python/pykwalify/pykwalify-1.7.0.ebuild
+++ b/dev-python/pykwalify/pykwalify-1.7.0.ebuild
@@ -3,7 +3,8 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{6,7,8} )
inherit distutils-r1
@@ -14,26 +15,21 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="MIT"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="test"
-RESTRICT="!test? ( test )"
RDEPEND="
>=dev-python/docopt-0.6.2[${PYTHON_USEDEP}]
>=dev-python/pyyaml-3.11[${PYTHON_USEDEP}]
>=dev-python/python-dateutil-2.4.2[${PYTHON_USEDEP}]
- dev-python/setuptools[${PYTHON_USEDEP}]
"
DEPEND="
- dev-python/setuptools[${PYTHON_USEDEP}]
test? (
- ${RDEPEND}
- dev-python/pytest[${PYTHON_USEDEP}]
dev-python/testfixtures[${PYTHON_USEDEP}]
)
"
-PATCHES=( "${FILESDIR}"/${PN}-1.4.0-S.patch )
+distutils_enable_tests pytest
-python_test() {
- pytest -vv || die
-}
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.0-S.patch
+ "${FILESDIR}"/${P}-test.patch
+)