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


##########
tests/operators/test_datetime.py:
##########
@@ -35,24 +34,23 @@
 INTERVAL = datetime.timedelta(hours=12)
 
 
-class TestBranchDateTimeOperator(unittest.TestCase):
+class TestBranchDateTimeOperator:
     @classmethod
-    def setUpClass(cls):
-        super().setUpClass()
+    def setup_class(cls):
 
         with create_session() as session:
             session.query(DagRun).delete()
             session.query(TI).delete()
 
-        cls.targets = [
-            (datetime.datetime(2020, 7, 7, 10, 0, 0), datetime.datetime(2020, 
7, 7, 11, 0, 0)),
-            (datetime.time(10, 0, 0), datetime.time(11, 0, 0)),
-            (datetime.datetime(2020, 7, 7, 10, 0, 0), datetime.time(11, 0, 0)),
-            (datetime.time(10, 0, 0), datetime.datetime(2020, 7, 7, 11, 0, 0)),
-            (datetime.time(11, 0, 0), datetime.time(10, 0, 0)),
-        ]
+    targets = [
+        (datetime.datetime(2020, 7, 7, 10, 0, 0), datetime.datetime(2020, 7, 
7, 11, 0, 0)),
+        (datetime.time(10, 0, 0), datetime.time(11, 0, 0)),
+        (datetime.datetime(2020, 7, 7, 10, 0, 0), datetime.time(11, 0, 0)),
+        (datetime.time(10, 0, 0), datetime.datetime(2020, 7, 7, 11, 0, 0)),
+        (datetime.time(10, 0, 0), datetime.time(11, 0, 0)),

Review Comment:
   > I did wrong by changing target_lower?
   
   I would suggest just drop latest parameter, because it duplicated. I can't 
imagine how we could resolve `target_lower >  target_upper` in case of 
`datetime.time`.
   
   This operator originally have a broken test scenario and that is why it pass 
in `main` branch now 🤣 
   
   



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