+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-twilio-8.11.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-twilio-8.11.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.18, pytest-7.4.4, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/twilio-python-8.11.1
collected 537 items / 2 errors
========================================================================================== ERRORS ===========================================================================================
______________________________________________________________________ ERROR collecting tests/cluster/test_webhook.py _______________________________________________________________________
tests/cluster/test_webhook.py:7: in <module>
class RequestHandler(BaseHTTPRequestHandler):
tests/cluster/test_webhook.py:9: in RequestHandler
validator = RequestValidator(os.environ["TWILIO_AUTH_TOKEN"])
/usr/lib64/python3.8/os.py:675: in __getitem__
raise KeyError(key) from None
E KeyError: 'TWILIO_AUTH_TOKEN'
_________________________________________________________________ ERROR collecting twilio/rest/events/v1/sink/sink_test.py __________________________________________________________________
import file mismatch:
imported module 'twilio.rest.events.v1.sink.sink_test' has this __file__ attribute:
/home/tkloczko/rpmbuild/BUILDROOT/python-twilio-8.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/twilio/rest/events/v1/sink/sink_test.py
which is not the same as the test file we want to collect:
/home/tkloczko/rpmbuild/BUILD/twilio-python-8.11.1/twilio/rest/events/v1/sink/sink_test.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
===================================================================================== warnings summary ======================================================================================
tests/unit/base/test_version.py:7
/home/tkloczko/rpmbuild/BUILD/twilio-python-8.11.1/tests/unit/base/test_version.py:7: PytestCollectionWarning: cannot collect test class 'TestPage' because it has a __init__ constructor (from: tests/unit/base/test_version.py)
class TestPage(Page):
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
ERROR tests/cluster/test_webhook.py - KeyError: 'TWILIO_AUTH_TOKEN'
ERROR twilio/rest/events/v1/sink/sink_test.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================================================== 1 warning, 2 errors in 1.20s ================================================================================
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-isolationbuildwith--no-isolationI'm using during all processes only locally installed modulescut off from access to the public network(pytest is executed with-m "not network")Here is pytest output:
List of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.