houqp commented on a change in pull request #9273:
URL: https://github.com/apache/airflow/pull/9273#discussion_r439760587



##########
File path: tests/api_connexion/endpoints/test_variable_endpoint.py
##########
@@ -29,38 +30,141 @@ def setUpClass(cls) -> None:
 
     def setUp(self) -> None:
         self.client = self.app.test_client()  # type:ignore
+        with create_session() as session:
+            session.query(Variable).delete()
+
+    def tearDown(self) -> None:
+        clear_db_connections()
 
 
 class TestDeleteVariable(TestVariableEndpoint):
-    @pytest.mark.skip(reason="Not implemented yet")
-    def test_should_response_200(self):
-        response = self.client.delete("/api/v1/variables/TEST_VARIABLE_KEY")
+    def test_should_response_204(self):
+        Variable.set("delete_var1", 1)
+        response = self.client.delete("/api/v1/variables/delete_var1")
+        print(response.data)

Review comment:
       good catch, that line should have been deleted.
   
   Thanks for the `pdb` suggestion. I think this is more of a personal 
preference :) I found print to be sufficient for 99% of my day to day debugging 
need. It is available in all languages and is more efficient to work with 
compared to using a debugger. The only few times when I had to use a debugger 
was for debugging kernel concurrency bugs when adding print statement will 
incur overhead on context switches and caused the concurrency bug to disappear 
;)
   Obviously my preference on debugger is heavily influenced by Linus: 
https://lkml.org/lkml/2000/9/6/65.




----------------------------------------------------------------
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]


Reply via email to