Taragolis commented on code in PR #37937:
URL: https://github.com/apache/airflow/pull/37937#discussion_r1514492716


##########
tests/models/test_baseoperatormeta.py:
##########
@@ -0,0 +1,64 @@
+import os
+from typing import Any
+from unittest import TestCase
+from unittest.mock import Mock, patch, MagicMock
+
+import pendulum
+from sqlalchemy.orm import Session
+
+from airflow import AirflowException, DAG
+from airflow.models import TaskInstance, DagRun
+from airflow.models.baseoperator import BaseOperator
+from airflow.utils.context import Context
+from airflow.utils.state import DagRunState
+
+
+class HelloWorldOperator(BaseOperator):
+    called = False
+
+    def execute(self, context: Context) -> Any:
+        HelloWorldOperator.called = True
+        return f"Hello {self.owner}!"
+
+
+class IterableSession(Session):
+    def __next__(self):
+        pass
+
+
+class BaseOperatorMetaTestCase(TestCase):

Review Comment:
   I guess there is only one mention 😄  
https://github.com/apache/airflow/blob/main/contributing-docs/testing/unit_tests.rst
   
   We completely get rid of `unittest.TestCase` in the beginning of the 2023, 
before that we have mixed of the `pytest` and `unittest.TestCase` classes (and 
accidentally nose specific methods), it was awful to be honest, something 
didn't work correctly with `unittest.TestCase`



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to