andriisoldatenko commented on a change in pull request #5547: [AIRFLOW-4911] 
Silence the FORBIDDEN errors from the KubernetesExecutor
URL: https://github.com/apache/airflow/pull/5547#discussion_r301275703
 
 

 ##########
 File path: tests/executors/test_kubernetes_executor.py
 ##########
 @@ -674,20 +674,11 @@ class TestKubernetesExecutor(unittest.TestCase):
     def test_run_next_exception(self, mock_get_kube_client, 
mock_kubernetes_job_watcher):
 
         # When a quota is exceeded this is the ApiException we get
-        r = HTTPResponse()
-        r.body = {
-            "kind": "Status",
 
 Review comment:
   this code is wrong, because of `urllib3/response.py:189`
   ```
   def __init__(self, body='', headers=None, status=0, version=0, reason=None,
                    strict=0, preload_content=True, decode_content=True,
                    original_response=None, pool=None, connection=None, 
msg=None,
                    retries=None, enforce_content_length=False,
                    request_method=None, request_url=None):
   ...
   
           if body and isinstance(body, (basestring, bytes)):
               self._body = body
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to