summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-11-27 11:10:17 +0100
committerMichał Górny <mgorny@gentoo.org>2021-11-27 11:27:28 +0100
commitee5976955db0aec96005ff4e51ef36c6d612934f (patch)
treee5d9affc5671b4261a7764ca13215f4e3fe7b542 /dev-python
parentdev-python/requests-toolbelt: Remove stale py2 patch (diff)
downloadgentoo-ee5976955db0aec96005ff4e51ef36c6d612934f.tar.gz
gentoo-ee5976955db0aec96005ff4e51ef36c6d612934f.tar.bz2
gentoo-ee5976955db0aec96005ff4e51ef36c6d612934f.zip
dev-python/requests-toolbelt: Replace patch with EPYTEST_DESELECT
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch28
-rw-r--r--dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild14
2 files changed, 11 insertions, 31 deletions
diff --git a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch
deleted file mode 100644
index b3dc2603c117..000000000000
--- a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/tests/test_multipart_encoder.py b/tests/test_multipart_encoder.py
-index 575f54c..73a880e 100644
---- a/tests/test_multipart_encoder.py
-+++ b/tests/test_multipart_encoder.py
-@@ -94,6 +94,7 @@ class TestFileFromURLWrapper(unittest.TestCase):
- s = requests.Session()
- self.recorder = get_betamax(s)
-
-+ @unittest.skip("test requires internet access")
- def test_read_file(self):
- url = ('https://stxnext.com/static/img/logo.830ebe551641.svg')
- with self.recorder.use_cassette(
-@@ -110,6 +111,7 @@ class TestFileFromURLWrapper(unittest.TestCase):
- assert chunk == b'ww.w3.org/'
- assert self.instance.len == 5147
-
-+ @unittest.skip("test requires internet access")
- def test_no_content_length_header(self):
- url = (
- 'https://api.github.com/repos/sigmavirus24/github3.py/releases/'
-@@ -191,6 +193,7 @@ class TestMultipartEncoder(unittest.TestCase):
- m = MultipartEncoder([('field', 'foo'), ('file', fd)])
- assert m.read() is not None
-
-+ @unittest.skip("test requires internet access")
- def test_reads_file_from_url_wrapper(self):
- s = requests.Session()
- recorder = get_betamax(s)
diff --git a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild
index ea834e88ccdd..145581a7c94d 100644
--- a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild
+++ b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild
@@ -29,10 +29,18 @@ PATCHES=(
"${FILESDIR}/requests-toolbelt-0.8.0-test-tracebacks.patch"
"${FILESDIR}/requests-toolbelt-0.9.1-tests.patch"
- # disable tests that require internet access
- "${FILESDIR}/requests-toolbelt-0.9.1-tests-internet.patch"
-
"${FILESDIR}/requests-toolbelt-0.9.1-py310.patch"
)
distutils_enable_tests pytest
+
+python_test() {
+ local EPYTEST_DESELECT=(
+ # Internet
+ tests/test_multipart_encoder.py::TestFileFromURLWrapper::test_no_content_length_header
+ tests/test_multipart_encoder.py::TestFileFromURLWrapper::test_read_file
+ tests/test_multipart_encoder.py::TestMultipartEncoder::test_reads_file_from_url_wrapper
+ )
+
+ epytest
+}