diff options
author | prspkt <prspkt@protonmail.com> | 2019-06-22 22:25:01 +0300 |
---|---|---|
committer | prspkt <prspkt@protonmail.com> | 2019-06-22 22:29:02 +0300 |
commit | 9979f5b0b1f3c4f2ecb919758e3adc45b5e998dd (patch) | |
tree | abab482a9018405bccd2c554793ea26e63abbdd1 /community/py3-pyhamcrest | |
parent | 980d9e2ba1f25efb0a0b3453518c1ddb001e7c96 (diff) | |
download | aports-9979f5b0b1f3c4f2ecb919758e3adc45b5e998dd.tar.bz2 aports-9979f5b0b1f3c4f2ecb919758e3adc45b5e998dd.tar.xz |
community/py3-pyhamcrest: move from testing
Diffstat (limited to 'community/py3-pyhamcrest')
-rw-r--r-- | community/py3-pyhamcrest/APKBUILD | 39 | ||||
-rw-r--r-- | community/py3-pyhamcrest/silence-warnings.patch | 87 |
2 files changed, 126 insertions, 0 deletions
diff --git a/community/py3-pyhamcrest/APKBUILD b/community/py3-pyhamcrest/APKBUILD new file mode 100644 index 0000000000..36e1a07a9b --- /dev/null +++ b/community/py3-pyhamcrest/APKBUILD @@ -0,0 +1,39 @@ +# Contributor: prspkt <prspkt@protonmail.com> +# Maintainer: prspkt <prspkt@protonmail.com> +pkgname=py3-pyhamcrest +_pkgname=PyHamcrest +pkgver=1.9.0 +pkgrel=2 +pkgdesc="Hamcrest framework for matcher objects" +url="https://github.com/hamcrest/PyHamcrest" +arch="noarch" +license="BSD-3-Clause" +depends="py3-six" +makedepends="py3-setuptools" +checkdepends="py3-hypothesis py3-mock py3-pytest" +source="$_pkgname-$pkgver.tar.gz::https://github.com/hamcrest/PyHamcrest/archive/V$pkgver.tar.gz + silence-warnings.patch" +builddir="$srcdir/"$_pkgname-$pkgver + +replaces="py3-hamcrest" # Backwards compatibility +provides="py3-hamcrest=$pkgver-r$pkgrel" # Backwards compatibility + +prepare() { + default_prepare + rm -f pytest.ini +} + +build() { + python3 setup.py build +} + +check() { + PYTHONPATH="build/lib" py.test-3 +} + +package() { + python3 setup.py install --prefix=/usr --root="$pkgdir" +} + +sha512sums="3a878637ed5138365416c170871a63640f089047b723c7ec8db893dd716c0b1cdad16a98584700405693b954af7d4868a8543d1a3fc58ded22b493c8c61661b4 PyHamcrest-1.9.0.tar.gz +8320f8c832ed3f90c11242b3bd6fad2327b3d6d1cda9a025b80453a4e69a34d39d338a21601f412d4f1903eab74bf7217c21e5ac31f84091e2f11cf6369a5658 silence-warnings.patch" diff --git a/community/py3-pyhamcrest/silence-warnings.patch b/community/py3-pyhamcrest/silence-warnings.patch new file mode 100644 index 0000000000..dfae1b8497 --- /dev/null +++ b/community/py3-pyhamcrest/silence-warnings.patch @@ -0,0 +1,87 @@ +From a916909e315eb219f79b99d927c54028d7af1fc4 Mon Sep 17 00:00:00 2001 +From: Simon Brunning <simon@brunningonline.net> +Date: Fri, 2 Nov 2018 09:50:20 +0000 +Subject: [PATCH] Silence warnings from tests due to use of old + pytest.parameterize() signature. + +--- + tests/hamcrest_unit_test/base_description_test.py | 8 ++++---- + tests/hamcrest_unit_test/core/is_test.py | 4 ++-- + tests/hamcrest_unit_test/core/isinstanceof_test.py | 8 ++++---- + 3 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/hamcrest_unit_test/base_description_test.py b/tests/hamcrest_unit_test/base_description_test.py +index 43d9bc9..ce76557 100644 +--- a/tests/hamcrest_unit_test/base_description_test.py ++++ b/tests/hamcrest_unit_test/base_description_test.py +@@ -34,10 +34,10 @@ def test_append_text_delegates(desc): + + @pytest.mark.parametrize('described, appended', ( + (Described(), 'described'), +- pytest.mark.skipif(six.PY3, reason="py2 only")((six.u('unicode-py2'), "'unicode-py2'")), +- pytest.mark.skipif(six.PY3, reason="py2 only")((six.b('bytes-py2'), "'bytes-py2'")), +- pytest.mark.skipif(six.PY2, reason="py3 only")((six.u('unicode-py3'), "'unicode-py3'")), +- pytest.mark.skipif(six.PY2, reason="py3 only")((six.b('bytes-py3'), "<b'bytes-py3'>")), ++ pytest.param(six.u('unicode-py2'), "'unicode-py2'", marks=pytest.mark.skipif(six.PY3, reason="py2 only")), ++ pytest.param(six.b('bytes-py2'), "'bytes-py2'", marks=pytest.mark.skipif(six.PY3, reason="py2 only")), ++ pytest.param(six.u('unicode-py3'), "'unicode-py3'", marks=pytest.mark.skipif(six.PY2, reason="py3 only")), ++ pytest.param(six.b('bytes-py3'), "<b'bytes-py3'>", marks=pytest.mark.skipif(six.PY2, reason="py3 only")), + (six.u("\U0001F4A9"), six.u("'{0}'").format(six.u("\U0001F4A9"))), + )) + def test_append_description_types(desc, described, appended): +diff --git a/tests/hamcrest_unit_test/core/is_test.py b/tests/hamcrest_unit_test/core/is_test.py +index 9205ddb..632c67c 100644 +--- a/tests/hamcrest_unit_test/core/is_test.py ++++ b/tests/hamcrest_unit_test/core/is_test.py +@@ -39,7 +39,7 @@ def test_description_should_pass_through_matcher(): + equal_matches = pytest.mark.parametrize('arg, identity, desc', ( + ('A', 'A', "'A'"), + (5 + 3, 8, "<8>"), +- pytest.mark.issue56((tuple(), (), "<()>")), ++ pytest.param(tuple(), (), "<()>", marks=pytest.mark.issue56()), + )) + + equal_mismatches = pytest.mark.parametrize('arg, identity, desc', ( +@@ -65,7 +65,7 @@ def test_description_uses_equal_to(arg, identity, desc): + @pytest.mark.parametrize('arg, identity', ( + ('A', str), + (1, int), +- only_py2((OldClass(), OldClass)), ++ pytest.param(OldClass(), OldClass, marks=only_py2()), + )) + def test_provides_instanceof_shortcut(arg, identity): + assert_matches(is_(identity), arg, "should match") +diff --git a/tests/hamcrest_unit_test/core/isinstanceof_test.py b/tests/hamcrest_unit_test/core/isinstanceof_test.py +index 862fd06..f74b84d 100644 +--- a/tests/hamcrest_unit_test/core/isinstanceof_test.py ++++ b/tests/hamcrest_unit_test/core/isinstanceof_test.py +@@ -26,7 +26,7 @@ class Child(Parent): + ('foo', instance_of((str, int))), + (1, instance_of((int, str))), + ('foo', instance_of((int, str))), +- only_py2((Parent(), instance_of(Parent))), ++ pytest.param(Parent(), instance_of(Parent), marks=only_py2()), + )) + def test_matching_evaluation(arg, matcher): + assert_matches(matcher, arg, 'same class') +@@ -35,14 +35,14 @@ def test_matching_evaluation(arg, matcher): + @pytest.mark.parametrize('arg, matcher', ( + ('hi', instance_of(int)), + (None, instance_of(int)), +- only_py2(('not a parent', instance_of(Parent))), +- only_py2((None, instance_of(Parent))), ++ pytest.param('not a parent', instance_of(Parent), marks=only_py2()), ++ pytest.param(None, instance_of(Parent), marks=only_py2()), + )) + def test_mismatching_evaluation(arg, matcher): + assert_does_not_match(matcher, arg, 'mismatched') + + @pytest.mark.parametrize('obj', ( +- pytest.mark.issue56(()), ++ pytest.param((), marks=pytest.mark.issue56()), + 'str', + )) + def test_matcher_creation_requires_type(obj): +-- +2.21.0 + |