-
Notifications
You must be signed in to change notification settings - Fork 392
3.9.1: pytest is failing in 5 units #551
Copy link
Copy link
Open
Description
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation- because I'm calling
buildwith--no-isolationI'm using during all processes only locally installed modules - install .whl file in </install/prefix>
- run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
- build is performed in env which is
cut off from access to the public network(pytest is executed with-m "not network")
Here is pytest output:
Details
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-twython-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-twython-3.9.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/twython-3.9.1
collected 132 items
tests/test_auth.py sssssssss [ 6%]
tests/test_core.py ....^[[AF.......FFF..F........ [ 26%]
tests/test_endpoints.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 86%]
tests/test_html_for_tweet.py ............. [ 96%]
tests/test_streaming.py sssss [100%]
========================================================================================= FAILURES ==========================================================================================
___________________________________________________________ TwythonAPITestCase.test_get_lastfunction_header_should_return_header ____________________________________________________________
self = <tests.test_core.TwythonAPITestCase testMethod=test_get_lastfunction_header_should_return_header>
@responses.activate
def test_get_lastfunction_header_should_return_header(self):
"""Test getting last specific header of the last API call works"""
endpoint = 'statuses/home_timeline'
url = self.get_url(endpoint)
self.register_response(responses.GET, url, adding_headers={'x-rate-limit-remaining': '37'})
self.api.get(endpoint)
value = self.api.get_lastfunction_header('x-rate-limit-remaining')
> self.assertEqual('37', value)
E AssertionError: '37' != None
tests/test_core.py:269: AssertionError
__________________________________________________________ TwythonAPITestCase.test_request_should_handle_400_for_missing_auth_data __________________________________________________________
self = <tests.test_core.TwythonAPITestCase testMethod=test_request_should_handle_400_for_missing_auth_data>
@responses.activate
def test_request_should_handle_400_for_missing_auth_data(self):
"""Test that Twython raises an auth error on 400 error when no oauth data sent"""
endpoint = 'statuses/home_timeline'
url = self.get_url(endpoint)
self.register_response(responses.GET, url,
body='{"errors":[{"message":"Bad Authentication data"}]}', status=400)
> self.assertRaises(TwythonAuthError, self.api.request, endpoint)
E AssertionError: TwythonAuthError not raised by request
tests/test_core.py:237: AssertionError
________________________________________________________ TwythonAPITestCase.test_request_should_handle_400_that_is_not_auth_related _________________________________________________________
self = <tests.test_core.TwythonAPITestCase testMethod=test_request_should_handle_400_that_is_not_auth_related>
@responses.activate
def test_request_should_handle_400_that_is_not_auth_related(self):
"""Test that Twython raises a normal error on 400 error when unrelated to authorization"""
endpoint = 'statuses/home_timeline'
url = self.get_url(endpoint)
self.register_response(responses.GET, url,
body='{"errors":[{"message":"Bad request"}]}', status=400)
> self.assertRaises(TwythonError, self.api.request, endpoint)
E AssertionError: TwythonError not raised by request
tests/test_core.py:247: AssertionError
_____________________________________________________________________ TwythonAPITestCase.test_request_should_handle_401 _____________________________________________________________________
self = <tests.test_core.TwythonAPITestCase testMethod=test_request_should_handle_401>
@responses.activate
def test_request_should_handle_401(self):
"""Test that Twython raises an auth error on 401 error"""
endpoint = 'statuses/home_timeline'
url = self.get_url(endpoint)
self.register_response(responses.GET, url, body='{"errors":[{"message":"Error"}]}', status=401)
> self.assertRaises(TwythonAuthError, self.api.request, endpoint)
E AssertionError: TwythonAuthError not raised by request
tests/test_core.py:227: AssertionError
_________________________________________________________________ TwythonAPITestCase.test_request_should_handle_rate_limit __________________________________________________________________
self = <tests.test_core.TwythonAPITestCase testMethod=test_request_should_handle_rate_limit>
@responses.activate
def test_request_should_handle_rate_limit(self):
"""Test that Twython raises an rate limit error on 429"""
endpoint = 'statuses/home_timeline'
url = self.get_url(endpoint)
self.register_response(responses.GET, url,
body='{"errors":[{"message":"Rate Limit"}]}', status=429)
> self.assertRaises(TwythonRateLimitError, self.api.request, endpoint)
E AssertionError: TwythonRateLimitError not raised by request
tests/test_core.py:257: AssertionError
================================================================================== short test summary info ==================================================================================
SKIPPED [1] tests/test_auth.py:17: skipping non-updated test
SKIPPED [1] tests/test_auth.py:24: skipping non-updated test
SKIPPED [1] tests/test_auth.py:43: skipping non-updated test
SKIPPED [1] tests/test_auth.py:49: skipping non-updated test
SKIPPED [1] tests/test_auth.py:31: skipping non-updated test
SKIPPED [1] tests/test_auth.py:37: skipping non-updated test
SKIPPED [1] tests/test_auth.py:56: skipping non-updated test
SKIPPED [1] tests/test_auth.py:61: skipping non-updated test
SKIPPED [1] tests/test_auth.py:67: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:353: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:259: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:176: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:457: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:320: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:372: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:264: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:181: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:325: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:215: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:530: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:497: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:503: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:284: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:290: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:109: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:347: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:152: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:207: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:145: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:200: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:468: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:69: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:166: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:427: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:396: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:365: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:401: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:439: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:37: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:92: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:171: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:491: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:302: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:50: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:56: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:97: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:75: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:451: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:114: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:484: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:433: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:515: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:525: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:510: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:139: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:336: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:331: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:341: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:42: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:419: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:253: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:247: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:314: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:308: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:159: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:269: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:520: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:297: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:63: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:473: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:103: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:478: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:279: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:130: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:120: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:195: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:360: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:445: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:80: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:274: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:407: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:225: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:85: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:230: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:186: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:237: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:242: skipping non-updated test
SKIPPED [1] tests/test_endpoints.py:220: skipping non-updated test
SKIPPED [1] tests/test_streaming.py:43: skipping non-updated test
SKIPPED [1] tests/test_streaming.py:30: skipping non-updated test
SKIPPED [1] tests/test_streaming.py:38: skipping non-updated test
SKIPPED [1] tests/test_streaming.py:34: skipping non-updated test
SKIPPED [1] tests/test_streaming.py:48: skipping non-updated test
FAILED tests/test_core.py::TwythonAPITestCase::test_get_lastfunction_header_should_return_header - AssertionError: '37' != None
FAILED tests/test_core.py::TwythonAPITestCase::test_request_should_handle_400_for_missing_auth_data - AssertionError: TwythonAuthError not raised by request
FAILED tests/test_core.py::TwythonAPITestCase::test_request_should_handle_400_that_is_not_auth_related - AssertionError: TwythonError not raised by request
FAILED tests/test_core.py::TwythonAPITestCase::test_request_should_handle_401 - AssertionError: TwythonAuthError not raised by request
FAILED tests/test_core.py::TwythonAPITestCase::test_request_should_handle_rate_limit - AssertionError: TwythonRateLimitError not raised by request
========================================================================= 5 failed, 34 passed, 93 skipped in 0.49s ==========================================================================Here is list of installed modules in build env
Details
Package Version
----------------------------- -----------------
alabaster 0.7.13
attrs 22.2.0
Babel 2.12.1
build 0.10.0
charset-normalizer 3.1.0
distro 1.8.0
docutils 0.19
exceptiongroup 1.0.0
gpg 1.19.0
idna 3.4
imagesize 1.4.1
importlib-metadata 6.2.0
iniconfig 2.0.0
installer 0.7.0
Jinja2 3.1.2
libcomps 0.1.19
MarkupSafe 2.1.2
oauthlib 3.2.2
packaging 23.0
pip 23.0.1
pluggy 1.0.0
Pygments 2.14.0
pyproject_hooks 1.0.0
pytest 7.2.2
python-dateutil 2.8.2
pytz 2023.2
PyYAML 6.0
requests 2.28.2
requests-oauthlib 1.3.1
responses 0.23.1
rpm 4.17.0
setuptools 65.6.3
six 1.16.0
snowballstemmer 2.2.0
Sphinx 6.1.3
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2.dev20230405
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1.dev20230405
sphinxcontrib-qthelp 1.0.3.dev20230405
sphinxcontrib-serializinghtml 1.1.5
tomli 2.0.1
urllib3 1.26.15
wheel 0.40.0
zipp 3.15.0Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels