googleapis / python-pubsub

Apache License 2.0
385 stars 200 forks source link

Suppress DeprecationWarnings observed during pytest runs #1188

Closed mukund-ananthu closed 2 months ago

mukund-ananthu commented 3 months ago

Example of warnings:

_____________ ERROR collecting samples/snippets/iam_test.py _________________
samples/snippets/iam_test.py:20: in <module>
    from google.api_core.exceptions import NotFound
.venv/lib/python3.11/site-packages/google/api_core/exceptions.py:29: in <module>
    from google.rpc import error_details_pb2
.venv/lib/python3.11/site-packages/google/rpc/__init__.py:18: in <module>
    import pkg_resources
.venv/lib/python3.11/site-packages/pkg_resources/__init__.py:102: in <module>
    warnings.warn(
E   DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
_____________ ERROR collecting samples/snippets/publisher_test.py ______________
samples/snippets/publisher_test.py:23: in <module>
    from google.api_core.exceptions import NotFound
.venv/lib/python3.11/site-packages/google/api_core/exceptions.py:29: in <module>
    from google.rpc import error_details_pb2
.venv/lib/python3.11/site-packages/google/rpc/__init__.py:18: in <module>
    import pkg_resources
.venv/lib/python3.11/site-packages/pkg_resources/__init__.py:102: in <module>
    warnings.warn(
E   DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
_______ ERROR collecting samples/snippets/quickstart/quickstart_test.py ________

Occurring over several tests:

024-06-07 19:56:02.242 [info] =========================== short test summary info ============================
ERROR samples/snippets/iam_test.py - DeprecationWarning: pkg_resources is dep...
ERROR samples/snippets/publisher_test.py - DeprecationWarning: pkg_resources ...
ERROR samples/snippets/quickstart/quickstart_test.py - DeprecationWarning: pk...
ERROR samples/snippets/schema_test.py - DeprecationWarning: pkg_resources is ...
ERROR samples/snippets/subscriber_test.py - DeprecationWarning: pkg_resources...
ERROR tests/unit/gapic/pubsub_v1/test_publisher.py - DeprecationWarning: pkg_...
ERROR tests/unit/gapic/pubsub_v1/test_schema_service.py - DeprecationWarning:...
ERROR tests/unit/gapic/pubsub_v1/test_subscriber.py - DeprecationWarning: pkg...
ERROR tests/unit/pubsub_v1/publisher/batch/test_base.py - DeprecationWarning:...
ERROR tests/unit/pubsub_v1/publisher/batch/test_thread.py - DeprecationWarnin...
ERROR tests/unit/pubsub_v1/publisher/sequencer/test_ordered_sequencer.py - De...
ERROR tests/unit/pubsub_v1/publisher/sequencer/test_unordered_sequencer.py - ...
ERROR tests/unit/pubsub_v1/publisher/test_flow_controller.py - DeprecationWar...
ERROR tests/unit/pubsub_v1/publisher/test_futures_publisher.py - DeprecationW...
ERROR tests/unit/pubsub_v1/publisher/test_publisher_client.py - DeprecationWa...
ERROR tests/unit/pubsub_v1/subscriber/test_dispatcher.py - DeprecationWarning...
ERROR tests/unit/pubsub_v1/subscriber/test_futures_subscriber.py - Deprecatio...
ERROR tests/unit/pubsub_v1/subscriber/test_heartbeater.py - DeprecationWarnin...
ERROR tests/unit/pubsub_v1/subscriber/test_helper_threads.py - DeprecationWar...
ERROR tests/unit/pubsub_v1/subscriber/test_histogram.py - DeprecationWarning:...
ERROR tests/unit/pubsub_v1/subscriber/test_leaser.py - DeprecationWarning: pk...
2024-06-07 19:56:02.243 [info] 
ERROR tests/unit/pubsub_v1/subscriber/test_message.py - DeprecationWarning: p...
ERROR tests/unit/pubsub_v1/subscriber/test_messages_on_hold.py - DeprecationW...
ERROR tests/unit/pubsub_v1/subscriber/test_scheduler.py - DeprecationWarning:...
ERROR tests/unit/pubsub_v1/subscriber/test_streaming_pull_manager.py - Deprec...
ERROR tests/unit/pubsub_v1/subscriber/test_subscriber_client.py - Deprecation...
ERROR tests/unit/pubsub_v1/test_futures.py - DeprecationWarning: pkg_resource...
ERROR tests/unit/test_pubsub.py - DeprecationWarning: pkg_resources is deprec...
!!!!!!!!!!!!!!!!!!! Interrupted: 28 errors during collection !!!!!!!!!!!!!!!!!!!