diff options
Diffstat (limited to 'dev-python/tavern')
-rw-r--r-- | dev-python/tavern/Manifest | 3 | ||||
-rw-r--r-- | dev-python/tavern/files/tavern-2.6.0-py312.patch | 38 | ||||
-rw-r--r-- | dev-python/tavern/tavern-2.6.0.ebuild | 59 |
3 files changed, 100 insertions, 0 deletions
diff --git a/dev-python/tavern/Manifest b/dev-python/tavern/Manifest index c2eed64b5ba9..bc3dec8e9c08 100644 --- a/dev-python/tavern/Manifest +++ b/dev-python/tavern/Manifest @@ -1,5 +1,8 @@ +AUX tavern-2.6.0-py312.patch 1704 BLAKE2B 9973ce4194c392e705be5bab9aa4b4919a5ce36855b9a51d5988eaf78fdee3b27fbf891cfd01135ef7bdc50dee91b6e6cccb308ee5687db04548d7d7a0eca033 SHA512 a0efcb2187ad760d59c67b9af8c00f3a7d6b74bc94fc1eeae132345ef90c6ac1b6404b766e8d912ca2f0ffc395e0dfaf6f14f190f761149a221c51ae71b53bd4 DIST tavern-2.3.0.gh.tar.gz 211676 BLAKE2B 80506d846036c7a68bf27c30e734a92983eadaff07e68a101e120a6284be750bc195817f1686cdaabe8dfe906720e5b41d22098db8f91e911438a60a2cbdd5db SHA512 2c1292cd047195b6e2059514f517b29caebeac3af370b298938cbbc8b5bc861dd818c3e45e25a65fa1acbbae96f36aa2d024edcee49b0086d459f3d41d4052ed DIST tavern-2.5.0.gh.tar.gz 217343 BLAKE2B bcb9d7f753b14351cd98e12e9d392f9effa716651f8686d053dc72080a2b738b02f78665f2bb07012b4c6ec7b39a661dfdc74a0272c036718cc13e2d731b4cee SHA512 9d957f815b57ba01d9707c1a3e8f715f062194efd0b24d82ebb99aec4bb83965e31a6538f3ff7748d3acd52b32cd38a097a4d36fe71faf1703dbf70ff0454111 +DIST tavern-2.6.0.gh.tar.gz 217509 BLAKE2B 99d9990757930a45a86a914fcf656b63266266869542cbd9b59850c7d648f54993ad5f409f12d09fbb12383c7586ecaeed323b04b478d62c7331cf514faa970a SHA512 1165dcc41244259d2ef7f69370dd35a40a9411b2a5c05e5dae45fc413d88478cd49aa540175a4a65dcf7dcd0eb2ee06b4f97059eb5d69ed5684893a8d5e8fcdc EBUILD tavern-2.3.0.ebuild 1239 BLAKE2B 942e4e8999d4bcb14ed13e64372bbc71421664b761ae75c5d6483fd7656ebb9b4bce7a5d1b99d899980c3d846cc9d7882fa0ccfa8e4c64662688c4e35b824995 SHA512 df36c2cadd47f54b615ee2fd68d9c0ab287915ffb77498c8250eabc511e5860248b1bbe49c94d525e8d885ccde7691eaead88584cffcea5042a89e647e8f9743 EBUILD tavern-2.5.0.ebuild 1248 BLAKE2B bc8dc7bb5516fe88b6dcf98a9289fcb8850ae3c98f6ca4c3cbacc162048e576f81b6a1f81fcd5e93671aeead7314cedf374492a3d4ce722aeff790637504e9a8 SHA512 0d6fcfcb8bff0a0643486271beb8abdb6183f71b8fdfe0d675f5d6c5f3c76e2e8caf0e4b769c5c8e35f98d8c04d73aba3c1df5fa3ace62235a0a94c01edffa8f +EBUILD tavern-2.6.0.ebuild 1345 BLAKE2B 35f495f9d310019357080a49837d811746623d62f08f6b2b86f69bbd3635017a0ebbbc335d96c1f0c51bc9645afa71f76cdd6c3fc104014bd808c48ed5ddff18 SHA512 b52d5fc9c473e180412a8301626f3d2ba21010d8237b1ad35f5ca48d6578c46e40e54d7872344bdc99f709bc63a941f702640e9a26a3e167a571ec2080cd0311 MISC metadata.xml 722 BLAKE2B 0ed7dd19f49aae7940de52b0df249979458b3950422e1089886929499d7a92d16a3a6e101b52313569900af6aec4e26388ae6d0673d5b1acef1e1615ed87d34a SHA512 3c30524ee5129700db664b5dab8635463ee17d4a45295583d79755c1f5b1dbba9ac611fcec3e9584028bfe96cf913f4f4b9d8da67a0e8ff6cde1ebedbf57c15a diff --git a/dev-python/tavern/files/tavern-2.6.0-py312.patch b/dev-python/tavern/files/tavern-2.6.0-py312.patch new file mode 100644 index 000000000000..679b0c9d2358 --- /dev/null +++ b/dev-python/tavern/files/tavern-2.6.0-py312.patch @@ -0,0 +1,38 @@ +From 8c09a6f31d84904dcf411e50102ac1ad159e4dd9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sun, 19 Nov 2023 08:56:20 +0100 +Subject: [PATCH] Fix assertion in TestCheckParseValues::test_warns_bad_type + +Fix the assertion in TestCheckParseValues::test_warns_bad_type +to use `.assert_called_with()` rather than non-existing `.called_with()` +method. The latter is wrongly interpreted as calling a mocked method +in Python < 3.12, and therefore does not test anything at all. Starting +with Python 3.12, it results in an error: + + AttributeError: 'called_with' is not a valid assertion. Use a spec for the mock if 'called_with' is meant to be an attribute. + +Fixing the call also revealed that the assertion was incorrect, so I've +updated it to match the current call. +--- + tests/unit/test_helpers.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/unit/test_helpers.py b/tests/unit/test_helpers.py +index 0d3da1c4..19fddc08 100644 +--- a/tests/unit/test_helpers.py ++++ b/tests/unit/test_helpers.py +@@ -300,10 +300,10 @@ def test_warns_bad_type(self, item): + with patch("tavern._core.dict_util.logger.warning") as wmock: + _check_and_format_values("{fd}", {"fd": item}) + +- assert wmock.called_with( +- "Formatting 'fd' will result in it being coerced to a string (it is a {})".format( +- type(item) +- ) ++ wmock.assert_called_with( ++ "Formatting '%s' will result in it being coerced to a string (it is a %s)", ++ "fd", ++ type(item), + ) + + @pytest.mark.parametrize("item", [1, "a", 1.3, format_keys("{s}", {"s": 2})]) diff --git a/dev-python/tavern/tavern-2.6.0.ebuild b/dev-python/tavern/tavern-2.6.0.ebuild new file mode 100644 index 000000000000..0f7c20bb2375 --- /dev/null +++ b/dev-python/tavern/tavern-2.6.0.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=flit +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 + +DESCRIPTION="A tool, library, and Pytest plugin for testing RESTful APIs" +HOMEPAGE=" + https://github.com/taverntesting/tavern/ + https://pypi.org/project/tavern/ +" +SRC_URI=" + https://github.com/taverntesting/tavern/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + dev-python/jmespath[${PYTHON_USEDEP}] + dev-python/paho-mqtt[${PYTHON_USEDEP}] + >=dev-python/pyjwt-2.6.0[${PYTHON_USEDEP}] + dev-python/pykwalify[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/python-box[${PYTHON_USEDEP}] + >=dev-python/pyyaml-6.0.1[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + dev-python/stevedore[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/colorlog[${PYTHON_USEDEP}] + dev-python/Faker[${PYTHON_USEDEP}] + dev-python/jsonschema[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +src_prepare() { + local PATCHES=( + "${FILESDIR}/${P}-py312.patch" + ) + + # strip unnecessary pins, upstream doesn't update them a lot + sed -i -E -e 's:,?<=?[0-9.]+::' pyproject.toml || die + distutils-r1_src_prepare +} + +python_test() { + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest -p tavern +} |