[Django]-Boto3 deprecation warning on import

2👍

I was able to get around this by ignoring the deprecation warning:

with warnings.catch_warnings():
  warnings.filterwarnings("ignore",category=DeprecationWarning)
  import boto3

8👍

I hid the warning with this code sequence:

try:
    import botocore
    import boto3
except ImportError:
    print("No module named botocore or boto3. You may need to install boto3")
    sys.exit(1)

boto3.compat.filter_python_deprecation_warnings()
👤DaveS

0👍

I ran into this same thing when introducing moto to a pytest suite. Incase it helps anyone you can also configure this via pytest.ini like this:

[pytest]
filterwarnings =
    ignore::DeprecationWarning

Leave a comment