When I try to make a request using:
request_arguments = {
"method": method,
"url": self._build_url(self.url, action),
"headers": self._get_headers(**kwargs),
"data": kwargs["data"] if "data" in kwargs else {},
"verify": False
}
response = requests.request(**request_arguments)
I'm getting the following warning:
tests/end_to_end/test_integration_alert.py::test_mm_put
/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py:858:
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
I tried to suppress it in the constructor via:
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
as described here:
Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6
Interestingly, I still get the warning the first time the code is called, but subsequent calls are correctly suppressed. (I hit the breakpoints in the correct order)
How can I suppress the initial warning as well?