Closed kloczek closed 1 year ago
Here is pytest output:
In case of
FAILED tests/test__cloud_sdk.py::test__run_subprocess_ignore_stderr - FileNotFoundError: [Errno 2] No such file or directory: 'python'
Looks like python interpreter executable is hardcoded. Instead shoud be used sys.executable
After add (for now) all failing units to --deselect list pytest shows warnings
============================================================================= warnings summary =============================================================================
google/auth/transport/_aiohttp_requests.py:201
/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/google/auth/transport/_aiohttp_requests.py:201: DeprecationWarning: Inheritance class AuthorizedSession from ClientSession is discouraged
class AuthorizedSession(aiohttp.ClientSession):
tests/transport/test__custom_tls_signer.py:22
/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/tests/transport/test__custom_tls_signer.py:22: DeprecationWarning: 'urllib3.contrib.pyopenssl' module is deprecated and will be removed in a future release of urllib3 2.x. Read more in this issue: https://github.com/urllib3/urllib3/issues/2680
import urllib3.contrib.pyopenssl # type: ignore
tests/transport/test_urllib3.py::TestAuthorizedHttp::test_urlopen_no_refresh
tests/transport/test_urllib3.py::TestAuthorizedHttp::test_urlopen_refresh
/usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function AuthorizedHttp.__del__ at 0x7f591a490160>
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/google/auth/transport/urllib3.py", line 432, in __del__
self.http.clear()
AttributeError: 'HttpStub' object has no attribute 'clear'
warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
tests_async/test_credentials_async.py::test_before_request
/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/tests_async/test_credentials_async.py:81: RuntimeWarning: coroutine 'Credentials.before_request' was never awaited
credentials.before_request(request, "http://example.com", "GET", headers)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests_async/transport/test_aiohttp_requests.py::TestRequestResponse::test_unsupported_session
/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/tests_async/transport/test_aiohttp_requests.py:119: DeprecationWarning: The object should be created within an async function
http = aiohttp.ClientSession(auto_decompress=True)
tests_async/transport/test_aiohttp_requests.py::TestRequestResponse::test_unsupported_session
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor_with_auth_request
/usr/lib64/python3.8/site-packages/aiohttp/connector.py:771: DeprecationWarning: The object should be created within an async function
super().__init__(
tests_async/transport/test_aiohttp_requests.py::TestRequestResponse::test_unsupported_session
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor_with_auth_request
/usr/lib64/python3.8/site-packages/aiohttp/connector.py:782: DeprecationWarning: The object should be created within an async function
resolver = DefaultResolver(loop=self._loop)
tests_async/transport/test_aiohttp_requests.py::TestRequestResponse::test_unsupported_session
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor_with_auth_request
/usr/lib64/python3.8/site-packages/aiohttp/cookiejar.py:67: DeprecationWarning: The object should be created within an async function
super().__init__(loop=loop)
tests_async/transport/test_aiohttp_requests.py::TestRequestResponse::test_timeout
/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/tests_async/transport/test_aiohttp_requests.py:128: RuntimeWarning: coroutine 'Request.__call__' was never awaited
request(url="http://example.com", method="GET", timeout=5)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor
tests_async/transport/test_aiohttp_requests.py::TestAuthorizedSession::test_constructor_with_auth_request
/home/tkloczko/rpmbuild/BUILD/google-auth-library-python-2.11.0/google/auth/transport/_aiohttp_requests.py:247: DeprecationWarning: The object should be created within an async function
super(AuthorizedSession, self).__init__()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
Hi @kloczek can you give me detailed steps to follow to reproduce this?
One sec ..
Make sure that you have installed build
module
git clone https://github.com/googleapis/google-auth-library-python/
cd google-auth-library-python
python3 -sBm build -w --no-isolation
python3 -sBm pip install -I dist/google_auth-*.whl --root /tmp/python-google-auth-2.11.0 --disable-pip-version-check --no-cache-dir --no-deps --no-index --no-warn-script-location --progress-bar off --verbose --ignore-installed --no-warn-script-location
PYTHONPATH=/tmp/python-google-auth-2.11.0 pytest -ra --ignore tests/test__oauth2client.py
Environment details
google-auth
version: 2.11.0Steps to reproduce
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
build
with--no-isolation
I'm using during all processes only locally installed modulesIn below pytesst execution I have vfew files on --ignore list because I have no yest packaged all necessry moduels. tests/test__oauth2client.py is on that listr because https://github.com/googleapis/google-auth-library-python/issues/1118
List of modules installed in build env