diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-04-30 12:37:28 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-04-30 12:37:28 +0100 |
commit | be9d77d3ac6af8f4ead98d89706f356b65578c93 (patch) | |
tree | f82923fbca262493e83dd1382e561a2fae24cc46 /dev-python/pytest-asyncio | |
parent | 7ec0832ab5dafbf70de83e0c2f3ee740416a0950 (diff) | |
parent | 6faaec2b812feecd9c8751b8a19004da4a17ea5b (diff) |
Merge branch 'edge' into next
Diffstat (limited to 'dev-python/pytest-asyncio')
4 files changed, 232 insertions, 8 deletions
diff --git a/dev-python/pytest-asyncio/Manifest b/dev-python/pytest-asyncio/Manifest index ac4cdf72169e..10079236b060 100644 --- a/dev-python/pytest-asyncio/Manifest +++ b/dev-python/pytest-asyncio/Manifest @@ -1,3 +1,6 @@ +AUX pytest-asyncio-0.10.0-py38.patch 7093 BLAKE2B 013901feddc45c5e5e832c5d2e016a1ccc4e8be29414ff350baf87b434fa29a803e030f7d4fe869e1276bce079cc075e0e876e8ff29cb6fa5f3abca5c83e77c6 SHA512 d9c3df879b288821a87a7dc1ca55e86e60007128af7dbdf54c7221b7f0c05b7750f8b1e7389a0956d5188d82f0ef8144678437e1391951fe0cfa63c872286ff0 DIST pytest-asyncio-0.10.0.tar.gz 13968 BLAKE2B 4e63d527b20c767b8f0777ed684a15abe54009be72db8a50ca3b37ef95dceb884168d8081c651e2bbd6d818529d6809bb3498055fedc7f951f5675d58f50e408 SHA512 78160d1918c5d3d2172f74fa07bf4bf6d0bc416666011dd5b83b3a7f385ec30fc65d49c01bba5dd0e16ad9dcd9d72d8ab062526f3268d60cd2e24a35b5a8f883 -EBUILD pytest-asyncio-0.10.0.ebuild 872 BLAKE2B 3394e769121c111ddb290b2f7f025dee6685f9e3b303ee0d193c5abd76047716a27aa79567dcfd8038958c7a1f85389a667e9936bc7210166a85c3fa233aad62 SHA512 eb734f482998cacd9ffaecddf26c3f3acf0981afa197b686de9d5ae0c95cb04de5f74722d9f6e783ae96b81046553e0820011966aa11abf056540aaba27bbc39 +DIST pytest-asyncio-0.11.0.tar.gz 14070 BLAKE2B a97cc52a013e126c7aa48b21e8fdfb69c589efffefdfe0f1cef09ce98c1dd150f4298bfa9d707dfc264a6d48c71839847f929237204ba2a36e1bb1aae4e95cbe SHA512 db1d6a9c4b3f6f24014eacf3b108d76e5b2d6761d35260f20023638cd898b6f0b499dd475bc07abd58bc73bee2a88b565c3ebcced2460e619a1b375fa6a27a64 +EBUILD pytest-asyncio-0.10.0.ebuild 833 BLAKE2B 7474a3709b045c8ba57623907eeb2fec75edff8f09d27be3ce9957c7dfc31836655ff2020a6c287a877df6705e9c11805bc33a870e8d407e076b3479f7cc6f48 SHA512 0211e34d00b6761465d543920a5341f5043317cc4d86a94401606647013efc3be81ea83e4d75ba9e1ef51f70ce00f26b8a590cc1d7635c4be7f24fd78a3fc3e5 +EBUILD pytest-asyncio-0.11.0.ebuild 762 BLAKE2B d55984ddaacc624f1f96457811448e4d3d9af28d8ab9ee5610b0def42beca68b2c6294afec80f55324451a623e3ed40151fac52f662eb35eaccb2bea22358763 SHA512 66f3e6661bf185adae6304480f4f5fec32ea0c8ea75177f8ce9111e00f87e7d8fc4b5bde230e7dfa3fe9899140d1ede0d4a1b42bf35dac5c8b8ba3dd887e8cb1 MISC metadata.xml 218 BLAKE2B 086fdcf7b63ca7bd6c58e861d717bb375e1cd372eff26d5d2eeeb176d8c5e6f10e653562abafb50eae7d7508f8e3d421b87e6a749acd0490308672828d0da697 SHA512 4558fee4c51117e21b1f42ca3edbdf1195ed297db798d6bfa0e5fbb7019654a187422b0abde7af5d800caffed66d1e55e4280e8be602bad591424d9776c46781 diff --git a/dev-python/pytest-asyncio/files/pytest-asyncio-0.10.0-py38.patch b/dev-python/pytest-asyncio/files/pytest-asyncio-0.10.0-py38.patch new file mode 100644 index 000000000000..5eee735007a0 --- /dev/null +++ b/dev-python/pytest-asyncio/files/pytest-asyncio-0.10.0-py38.patch @@ -0,0 +1,187 @@ +From ab2b14048a691479fa9f8811aaa558018c6db6e3 Mon Sep 17 00:00:00 2001 +From: Andrew Svetlov <andrew.svetlov@gmail.com> +Date: Thu, 9 Apr 2020 08:44:46 +0200 +Subject: [PATCH] Test on Python 3.8, drop 3.3 and 3.4 + +--- + .travis.yml | 7 +++--- + setup.py | 1 + + tests/conftest.py | 2 +- + tests/test_hypothesis_integration.py | 2 +- + tests/test_simple.py | 32 +++++++++++----------------- + tests/test_simple_35.py | 17 ++++++--------- + tests/test_subprocess.py | 6 ++---- + tox.ini | 5 +++-- + 8 files changed, 29 insertions(+), 43 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 6203cf8..cc2ec16 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -17,7 +17,7 @@ def dependent_fixture(event_loop): + async def just_a_sleep(): + """Just sleep a little while.""" + nonlocal event_loop +- await asyncio.sleep(0.1, loop=event_loop) ++ await asyncio.sleep(0.1) + nonlocal counter + counter += 1 + +diff --git a/tests/test_simple.py b/tests/test_simple.py +index 1627139..00c07fc 100644 +--- a/tests/test_simple.py ++++ b/tests/test_simple.py +@@ -1,28 +1,26 @@ + """Quick'n'dirty unit tests for provided fixtures and markers.""" + import asyncio +-import os + import pytest + + import pytest_asyncio.plugin + + +-async def async_coro(loop=None): +- """A very simple coroutine.""" +- await asyncio.sleep(0, loop=loop) ++async def async_coro(): ++ await asyncio.sleep(0) + return 'ok' + + + def test_event_loop_fixture(event_loop): + """Test the injection of the event_loop fixture.""" + assert event_loop +- ret = event_loop.run_until_complete(async_coro(event_loop)) ++ ret = event_loop.run_until_complete(async_coro()) + assert ret == 'ok' + + + @pytest.mark.asyncio +-def test_asyncio_marker(): ++async def test_asyncio_marker(): + """Test the asyncio pytest marker.""" +- yield # sleep(0) ++ await asyncio.sleep(0) + + + @pytest.mark.xfail(reason='need a failure', strict=True) +@@ -45,13 +43,11 @@ async def closer(_, writer): + writer.close() + + server1 = await asyncio.start_server(closer, host='localhost', +- port=unused_tcp_port, +- loop=event_loop) ++ port=unused_tcp_port) + + with pytest.raises(IOError): + await asyncio.start_server(closer, host='localhost', +- port=unused_tcp_port, +- loop=event_loop) ++ port=unused_tcp_port) + + server1.close() + await server1.wait_closed() +@@ -68,20 +64,16 @@ async def closer(_, writer): + unused_tcp_port_factory()) + + server1 = await asyncio.start_server(closer, host='localhost', +- port=port1, +- loop=event_loop) ++ port=port1) + server2 = await asyncio.start_server(closer, host='localhost', +- port=port2, +- loop=event_loop) ++ port=port2) + server3 = await asyncio.start_server(closer, host='localhost', +- port=port3, +- loop=event_loop) ++ port=port3) + + for port in port1, port2, port3: + with pytest.raises(IOError): + await asyncio.start_server(closer, host='localhost', +- port=port, +- loop=event_loop) ++ port=port) + + server1.close() + await server1.wait_closed() +@@ -117,7 +109,7 @@ class Test: + @pytest.mark.asyncio + async def test_asyncio_marker_method(self, event_loop): + """Test the asyncio pytest marker in a Test class.""" +- ret = await async_coro(event_loop) ++ ret = await async_coro() + assert ret == 'ok' + + +diff --git a/tests/test_simple_35.py b/tests/test_simple_35.py +index 1e4d697..4141fb0 100644 +--- a/tests/test_simple_35.py ++++ b/tests/test_simple_35.py +@@ -6,7 +6,7 @@ + + @pytest.mark.asyncio + async def async_coro(loop): +- await asyncio.sleep(0, loop=loop) ++ await asyncio.sleep(0) + return 'ok' + + +@@ -27,8 +27,7 @@ async def closer(_, writer): + writer.close() + + server1 = await asyncio.start_server(closer, host='localhost', +- port=unused_tcp_port, +- loop=event_loop) ++ port=unused_tcp_port) + + server1.close() + await server1.wait_closed() +@@ -45,20 +44,16 @@ async def closer(_, writer): + + async def run_test(): + server1 = await asyncio.start_server(closer, host='localhost', +- port=port1, +- loop=event_loop) ++ port=port1) + server2 = await asyncio.start_server(closer, host='localhost', +- port=port2, +- loop=event_loop) ++ port=port2) + server3 = await asyncio.start_server(closer, host='localhost', +- port=port3, +- loop=event_loop) ++ port=port3) + + for port in port1, port2, port3: + with pytest.raises(IOError): + await asyncio.start_server(closer, host='localhost', +- port=port, +- loop=event_loop) ++ port=port) + + server1.close() + await server1.wait_closed() +diff --git a/tests/test_subprocess.py b/tests/test_subprocess.py +index 83490e8..069c6c2 100644 +--- a/tests/test_subprocess.py ++++ b/tests/test_subprocess.py +@@ -21,8 +21,7 @@ def event_loop(): + async def test_subprocess(event_loop): + """Starting a subprocess should be possible.""" + proc = await asyncio.subprocess.create_subprocess_exec( +- sys.executable, '--version', stdout=asyncio.subprocess.PIPE, +- loop=event_loop) ++ sys.executable, '--version', stdout=asyncio.subprocess.PIPE) + await proc.communicate() + + +@@ -30,6 +29,5 @@ async def test_subprocess(event_loop): + async def test_subprocess_forbid(event_loop): + """Starting a subprocess should be possible.""" + proc = await asyncio.subprocess.create_subprocess_exec( +- sys.executable, '--version', stdout=asyncio.subprocess.PIPE, +- loop=event_loop) ++ sys.executable, '--version', stdout=asyncio.subprocess.PIPE) + await proc.communicate() diff --git a/dev-python/pytest-asyncio/pytest-asyncio-0.10.0.ebuild b/dev-python/pytest-asyncio/pytest-asyncio-0.10.0.ebuild index e2189976b477..b5141f97fa04 100644 --- a/dev-python/pytest-asyncio/pytest-asyncio-0.10.0.ebuild +++ b/dev-python/pytest-asyncio/pytest-asyncio-0.10.0.ebuild @@ -3,7 +3,9 @@ EAPI=7 -PYTHON_COMPAT=( python3_{6,7} ) +DISTUTILS_USE_SETUPTOOLS=rdepend +PYTHON_COMPAT=( python3_{6,7,8} ) + inherit distutils-r1 DESCRIPTION="Library for testing asyncio code with pytest" @@ -14,19 +16,20 @@ SRC_URI="https://github.com/pytest-dev/pytest-asyncio/archive/v${PV}.tar.gz -> $ LICENSE="Apache-2.0" SLOT="0" KEYWORDS="amd64 ~ppc64 x86" -IUSE="test" -RESTRICT="!test? ( test )" -RDEPEND=" - dev-python/pytest[${PYTHON_USEDEP}] - dev-python/setuptools[${PYTHON_USEDEP}]" -DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] +DEPEND=" test? ( ${RDEPEND} dev-python/async_generator[${PYTHON_USEDEP}] >=dev-python/hypothesis-3.64[${PYTHON_USEDEP}] )" +PATCHES=( + "${FILESDIR}"/pytest-asyncio-0.10.0-py38.patch +) + +distutils_enable_tests pytest + python_test() { distutils_install_for_testing pytest -vv || die "Tests fail with ${EPYTHON}" diff --git a/dev-python/pytest-asyncio/pytest-asyncio-0.11.0.ebuild b/dev-python/pytest-asyncio/pytest-asyncio-0.11.0.ebuild new file mode 100644 index 000000000000..25b48145d633 --- /dev/null +++ b/dev-python/pytest-asyncio/pytest-asyncio-0.11.0.ebuild @@ -0,0 +1,31 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_USE_SETUPTOOLS=rdepend +PYTHON_COMPAT=( python3_{6,7,8} ) + +inherit distutils-r1 + +DESCRIPTION="Library for testing asyncio code with pytest" +HOMEPAGE="https://github.com/pytest-dev/pytest-asyncio + https://pypi.org/project/pytest-asyncio/" +SRC_URI="https://github.com/pytest-dev/pytest-asyncio/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~ppc64 ~x86" + +BDEPEND=" + test? ( + dev-python/async_generator[${PYTHON_USEDEP}] + >=dev-python/hypothesis-3.64[${PYTHON_USEDEP}] + )" + +distutils_enable_tests pytest + +python_test() { + distutils_install_for_testing + pytest -vv || die "Tests fail with ${EPYTHON}" +} |