Comments (6)
Just tested that and looks like it works 👍 😄
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.E3TH4T
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd /home/tkloczko/rpmbuild/BUILD
+ rm -rf requests-futures-1.0.0
+ /usr/bin/gzip -dc /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-1.0.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd requests-futures-1.0.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Fix-rst-title-underline.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-No-mutable-kwarg-in-ElapsedFutureSession-example.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-DOcumenting-how-to-iterate-over-a-list-of-requests-r.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Document-how-to-access-the-request-url-and-add-addit.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-docs-fix-simple-typo-interpretor-interpreter.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Configure-the-generation-of-a-universal-wheel.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Fix-the-failing-test-by-switching-to-https-nghttp2.o.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Create-FUNDING.yml.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-combine-requirements.txt-files.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-unified-requirements.txt-in-MANIFEST.in.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Fix-setup.py-long_description_content_type.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Add-release-script-and-twine-build-deps.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Document-support-for-py3.6-3.7-and-3.8.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Apply-suggestions-from-code-review.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Updates-README.rst-with-svg-badge.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-scripts-to-rule-them-all-full-setup.py-requirements-.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Missed-cibuild-setup-py.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Switch-to-Actions-for-CI.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Add-stale-issue-pr-action.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-black-formatting.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-ignore-re-formatting-rev-with-.git-blame-ignore-revs.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-run-black-formatting-during-ci-and-pre-commit.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Update-requires-to-get-rid-of-py.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Bump-certifi-from-2022.9.24-to-2022.12.7.patch
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Update-requirements-.txt.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Bump-markdown-it-py-from-2.1.0-to-2.2.0.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Bump-requests-from-2.28.2-to-2.31.0.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-Update-requirements-.txt-1.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-py3.7-is-gone-add-3.11.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/python-requests-futures-pytest-mark-network-pyproject.toml-isort.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ RPM_EC=0
[..]
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/requests-futures-1.0.0
configfile: pyproject.toml
plugins: find-dependencies-0.5.2
collected 12 items / 10 deselected / 2 selected
tests/test_requests_futures.py .. [100%]
============================================================================= 2 passed, 10 deselected in 0.09s ==============================================================================
+ RPM_EC=0
++ jobs -p
+ exit 0
Processing files: python-requests-futures-1.0.0-16.fc35.noarch
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.JrwKRR
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd requests-futures-1.0.0
+ DOCDIR=/home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/share/doc/python-requests-futures
+ export LC_ALL=C
+ LC_ALL=C
+ export DOCDIR
+ /usr/bin/mkdir -p /home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/share/doc/python-requests-futures
+ cp -pr README.rst /home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/share/doc/python-requests-futures
+ RPM_EC=0
++ jobs -p
+ exit 0
Provides: python-requests-futures = 1.0.0-16.fc35 python3.8dist(requests-futures) = 1 python3dist(requests-futures) = 1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: python(abi) = 3.8 python3.8dist(requests) >= 1.2
Obsoletes: python3-requests-futures
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64
Wrote: /home/tkloczko/rpmbuild/SRPMS/python-requests-futures-1.0.0-16.fc35.src.rpm
Wrote: /home/tkloczko/rpmbuild/RPMS/python-requests-futures-1.0.0-16.fc35.noarch.rpm
from requests-futures.
Interesting. After --deselect those two units another unit popped out.
Looks like it is some dependency between units
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-requests-futures-1.0.0-16.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' --deselect test_requests_futures.py::RequestsProcessPoolTestCase::test_futures_existing_session --deselect test_requests_futures.py::RequestsTestCase::test_redirect
============================= test session starts ==============================
platform linux -- Python 3.8.17, pytest-7.3.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/requests-futures-1.0.0
collected 12 items / 2 deselected / 10 selected
test_requests_futures.py .......sFs [100%]
=================================== FAILURES ===================================
_______________ RequestsProcessPoolTestCase.test_futures_session _______________
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib64/python3.8/concurrent/futures/process.py", line 239, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/home/tkloczko/rpmbuild/BUILD/requests-futures-1.0.0/requests_futures/sessions.py", line 34, in wrap
return background_callback(self, resp) or resp
File "/home/tkloczko/rpmbuild/BUILD/requests-futures-1.0.0/test_requests_futures.py", line 159, in global_cb_return_result
assert r, Response
AssertionError: <class 'requests.models.Response'>
assert <Response [504]>
"""
The above exception was the direct cause of the following exception:
self = <test_requests_futures.RequestsProcessPoolTestCase testMethod=test_futures_session>
@skipIf(session_required, 'not supported in python < 3.5')
def test_futures_session(self):
> self._assert_futures_session()
test_requests_futures.py:181:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_requests_futures.py:223: in _assert_futures_session
resp = future.result()
/usr/lib64/python3.8/concurrent/futures/_base.py:444: in result
return self.__get_result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = None
def __get_result(self):
if self._exception:
try:
> raise self._exception
E AssertionError: <class 'requests.models.Response'>
E assert <Response [504]>
/usr/lib64/python3.8/concurrent/futures/_base.py:389: AssertionError
=========================== short test summary info ============================
SKIPPED [1] test_requests_futures.py:183: fully supported on python >= 3.5
SKIPPED [1] test_requests_futures.py:282: Exception raised when unsupported
FAILED test_requests_futures.py::RequestsProcessPoolTestCase::test_futures_session
======= 1 failed, 7 passed, 2 skipped, 2 deselected in 94.77s (0:01:34) ========
from requests-futures.
The tests currently do hit the network as part of their running and aren't fully mocked so an env w/o network access will definitely cause problems, likely all the tests will fail.
IIRC httpbin may be an installable thing, but not sure how reasonable it'd be to spin it up as part of unit tests. The other option would be to fully mock all the calls, but back when I originally wrote this I decided that wouldn't be a thorough enough test to be meaningful since 100% of the things being checked would be mocked out and everything would completely depend on what I expected the mocks to return and not what an actual HTTP server does. Mainly the worry would be that I could make changes to the request that would cause the server to behave differently, but my mocks wouldn't so I wouldn't find problems.
Not sure what the best path forward here is. These tests have worked well enough for 10+ years. Not particularly motivated to mock them just to get an RPM build happy.
Alternatively we could potentially do a test for network connectivity and skip pretty much all the tests if we can't talk to the network.
from requests-futures.
Is it possible to mark units like tar using @pytest.mark.network
? 🤔
https://docs.pytest.org/en/7.1.x/example/markers.html
Many other modules uses already that mark in pytest test suite in case of units which needs access to anything more than localhost.
I've started test using pytest-find-dependencies
however it still did not finish ..
from requests-futures.
#134 should get the mark in place. If you want to give it a try and 👍 on that PR I'll ship it.
from requests-futures.
One sec 😋
from requests-futures.
Related Issues (20)
- OSError Issues when used within celery task (gevent) HOT 2
- Adding attribute to response via hook (as seen in examples) fails HOT 1
- Cannot switch to a different thread HOT 3
- Possibility to accept old SSL versions? HOT 1
- Problem with data field in header request HOT 1
- Making a future request and letting callback work with result - some are missing HOT 2
- Error When there is a large parallel Requests go. HOT 2
- Provide wheels on PyPI HOT 1
- How do we pass arguments to the hooks? HOT 3
- AttributeError: 'Future' object has no attribute 'status_code' HOT 1
- 1.0.0: missing git tag HOT 5
- Response for batched requests HOT 6
- Add type annotations HOT 4
- Not showing as updated on PyPI HOT 3
- On exception it returns xx (Caused By None), whereas the requests module returns xx (Caused By xx) HOT 4
- The elapsed time hook example does not work HOT 3
- Use pytest-httpbin? HOT 8
- Attribute set via response hooks does not work with ProcessPoolExecutor HOT 4
- RFE: preserve contextvars when performing the request HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from requests-futures.