public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/betamax/, dev-python/betamax/files/
@ 2022-05-22  9:01 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2022-05-22  9:01 UTC (permalink / raw
  To: gentoo-commits

commit:     8d607e82728af8b47ab080d7fb579248d74fdd58
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 08:54:16 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May 22 08:54:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d607e82

dev-python/betamax: Modernize and fix tests

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/betamax/betamax-0.8.1-r1.ebuild         | 42 ++++++++++++----------
 .../betamax/files/betamax-0.8.1-pytest.patch       | 38 ++++++++++++++++++++
 2 files changed, 62 insertions(+), 18 deletions(-)

diff --git a/dev-python/betamax/betamax-0.8.1-r1.ebuild b/dev-python/betamax/betamax-0.8.1-r1.ebuild
index 9bfbc639f340..b6b1380f35fe 100644
--- a/dev-python/betamax/betamax-0.8.1-r1.ebuild
+++ b/dev-python/betamax/betamax-0.8.1-r1.ebuild
@@ -5,34 +5,40 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{8..11} pypy3 )
 DISTUTILS_USE_PEP517=setuptools
+
 inherit distutils-r1
 
 DESCRIPTION="python-requests HTTP exchanges recorder"
-HOMEPAGE="https://github.com/betamaxpy/betamax"
+HOMEPAGE="
+	https://github.com/betamaxpy/betamax/
+	https://pypi.org/project/betamax/
+"
 SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz"
 
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
 
-RDEPEND="dev-python/requests[${PYTHON_USEDEP}]"
+RDEPEND="
+	dev-python/requests[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
 
 PATCHES=(
-	"${FILESDIR}/betamax-0.8.1-tests.patch"
+	"${FILESDIR}/${P}-pytest.patch"
 )
 
-distutils_enable_tests pytest
-
-src_prepare() {
-	rm tests/integration/test_hooks.py || die
-	rm tests/integration/test_placeholders.py || die
-	sed -e 's:test_records:_&:' \
-		-e 's:test_replaces:_&:' \
-		-e 's:test_replays:_&:' \
-		-e 's:test_creates:_&:' \
-		-i tests/integration/test_record_modes.py || die
-	rm tests/integration/test_unicode.py || die
-	rm tests/regression/test_gzip_compression.py || die
-	rm tests/regression/test_requests_2_11_body_matcher.py || die
-	distutils-r1_src_prepare
-}
+EPYTEST_DESELECT=(
+	# Internet
+	tests/integration/test_hooks.py
+	tests/integration/test_placeholders.py
+	tests/integration/test_record_modes.py::TestRecordOnce::test_records_new_interaction
+	tests/integration/test_record_modes.py::TestRecordOnce::test_replays_response_from_cassette
+	tests/integration/test_record_modes.py::TestRecordNewEpisodes
+	tests/integration/test_record_modes.py::TestRecordNewEpisodesCreatesCassettes
+	tests/integration/test_record_modes.py::TestRecordAll
+	tests/integration/test_unicode.py
+	tests/regression/test_gzip_compression.py
+	tests/regression/test_requests_2_11_body_matcher.py
+)

diff --git a/dev-python/betamax/files/betamax-0.8.1-pytest.patch b/dev-python/betamax/files/betamax-0.8.1-pytest.patch
new file mode 100644
index 000000000000..e3bfe39c81ca
--- /dev/null
+++ b/dev-python/betamax/files/betamax-0.8.1-pytest.patch
@@ -0,0 +1,38 @@
+From 165cc321f2b9839418269e9493b03eb2e43f7ddf Mon Sep 17 00:00:00 2001
+From: Jiri Kuncar <jiri.kuncar@gmail.com>
+Date: Mon, 9 Sep 2019 12:23:18 +0200
+Subject: [PATCH] tests: fix direct calls to PyTest fixtures
+
+https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly
+---
+ tests/unit/test_fixtures.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tests/unit/test_fixtures.py b/tests/unit/test_fixtures.py
+index 387d9ce..41f33eb 100644
+--- a/tests/unit/test_fixtures.py
++++ b/tests/unit/test_fixtures.py
+@@ -27,9 +27,9 @@ def test_adds_stop_as_a_finalizer(self):
+         # Mock a pytest request object
+         request = mock.MagicMock()
+         request.cls = request.module = None
+-        request.function.__name__ = 'test'
++        request.node.name = request.function.__name__ = 'test'
+ 
+-        pytest_fixture.betamax_recorder(request)
++        pytest_fixture._betamax_recorder(request)
+         assert request.addfinalizer.called is True
+         request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop)
+ 
+@@ -37,9 +37,9 @@ def test_auto_starts_the_recorder(self):
+         # Mock a pytest request object
+         request = mock.MagicMock()
+         request.cls = request.module = None
+-        request.function.__name__ = 'test'
++        request.node.name = request.function.__name__ = 'test'
+ 
+-        pytest_fixture.betamax_recorder(request)
++        pytest_fixture._betamax_recorder(request)
+         self.mocked_betamax.start.assert_called_once_with()
+ 
+ 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/betamax/, dev-python/betamax/files/
@ 2024-02-24 10:22 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-02-24 10:22 UTC (permalink / raw
  To: gentoo-commits

commit:     6ebb5d1ccfa448000fd97e1df5f36b5c3ee33e34
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 24 10:16:15 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb 24 10:22:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ebb5d1c

dev-python/betamax: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/betamax/Manifest                        |  1 -
 dev-python/betamax/betamax-0.8.1-r2.ebuild         | 45 ----------------------
 .../betamax/files/betamax-0.8.1-pytest.patch       | 38 ------------------
 3 files changed, 84 deletions(-)

diff --git a/dev-python/betamax/Manifest b/dev-python/betamax/Manifest
index 2aab68cdd71a..2d8fa1990038 100644
--- a/dev-python/betamax/Manifest
+++ b/dev-python/betamax/Manifest
@@ -1,2 +1 @@
-DIST betamax-0.8.1.tar.gz 77526 BLAKE2B 2ce88326c5ef80082908912c4b14f149793c4457c47446ebcabaaffaa6b0ee64528096acc6bdd868fce0fad3d10ad66697cad5dc422c15b324e1cc9ae20eafa6 SHA512 89bfb56cf4004a70ec8c1f2342cfa0e02f850b8ed80b67f8b2b02c1a2093e8ac1cf1b9980354551e9d3a21fadde0d77d717f1559487024941973cd80bd451734
 DIST betamax-0.9.0.tar.gz 79957 BLAKE2B fed287985207679587a0d2a2f38748fca87b7ec9516135c3e50bcfc5bd8035136b4edcac1e3af143cf2f32caa79b5c76e9a9f450d9488f06673aa4d672b09956 SHA512 a6b8f4d719dbfdc26b39f4cb16e33db1da85e01bceb871640d2778e7d830ef2d3bcd655aba6382136cb5cd66d8db1fa6ab04c942e5e185702337cd3dc8c1fa15

diff --git a/dev-python/betamax/betamax-0.8.1-r2.ebuild b/dev-python/betamax/betamax-0.8.1-r2.ebuild
deleted file mode 100644
index 9aae04ce98e9..000000000000
--- a/dev-python/betamax/betamax-0.8.1-r2.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{10..12} pypy3 )
-DISTUTILS_USE_PEP517=setuptools
-
-inherit distutils-r1 pypi
-
-DESCRIPTION="python-requests HTTP exchanges recorder"
-HOMEPAGE="
-	https://github.com/betamaxpy/betamax/
-	https://pypi.org/project/betamax/
-"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
-
-# urllib3-2 blocked by https://github.com/betamaxpy/betamax/issues/200
-RDEPEND="
-	dev-python/requests[${PYTHON_USEDEP}]
-	<dev-python/urllib3-2[${PYTHON_USEDEP}]
-"
-
-distutils_enable_tests pytest
-
-PATCHES=(
-	"${FILESDIR}/${P}-pytest.patch"
-)
-
-EPYTEST_DESELECT=(
-	# Internet
-	tests/integration/test_hooks.py
-	tests/integration/test_placeholders.py
-	tests/integration/test_record_modes.py::TestRecordOnce::test_records_new_interaction
-	tests/integration/test_record_modes.py::TestRecordOnce::test_replays_response_from_cassette
-	tests/integration/test_record_modes.py::TestRecordNewEpisodes
-	tests/integration/test_record_modes.py::TestRecordNewEpisodesCreatesCassettes
-	tests/integration/test_record_modes.py::TestRecordAll
-	tests/integration/test_unicode.py
-	tests/regression/test_gzip_compression.py
-	tests/regression/test_requests_2_11_body_matcher.py
-)

diff --git a/dev-python/betamax/files/betamax-0.8.1-pytest.patch b/dev-python/betamax/files/betamax-0.8.1-pytest.patch
deleted file mode 100644
index e3bfe39c81ca..000000000000
--- a/dev-python/betamax/files/betamax-0.8.1-pytest.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 165cc321f2b9839418269e9493b03eb2e43f7ddf Mon Sep 17 00:00:00 2001
-From: Jiri Kuncar <jiri.kuncar@gmail.com>
-Date: Mon, 9 Sep 2019 12:23:18 +0200
-Subject: [PATCH] tests: fix direct calls to PyTest fixtures
-
-https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly
----
- tests/unit/test_fixtures.py | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/tests/unit/test_fixtures.py b/tests/unit/test_fixtures.py
-index 387d9ce..41f33eb 100644
---- a/tests/unit/test_fixtures.py
-+++ b/tests/unit/test_fixtures.py
-@@ -27,9 +27,9 @@ def test_adds_stop_as_a_finalizer(self):
-         # Mock a pytest request object
-         request = mock.MagicMock()
-         request.cls = request.module = None
--        request.function.__name__ = 'test'
-+        request.node.name = request.function.__name__ = 'test'
- 
--        pytest_fixture.betamax_recorder(request)
-+        pytest_fixture._betamax_recorder(request)
-         assert request.addfinalizer.called is True
-         request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop)
- 
-@@ -37,9 +37,9 @@ def test_auto_starts_the_recorder(self):
-         # Mock a pytest request object
-         request = mock.MagicMock()
-         request.cls = request.module = None
--        request.function.__name__ = 'test'
-+        request.node.name = request.function.__name__ = 'test'
- 
--        pytest_fixture.betamax_recorder(request)
-+        pytest_fixture._betamax_recorder(request)
-         self.mocked_betamax.start.assert_called_once_with()
- 
- 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-24 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-22  9:01 [gentoo-commits] repo/gentoo:master commit in: dev-python/betamax/, dev-python/betamax/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2024-02-24 10:22 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox