You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Abhishek-kumar-samsung (via GitHub)" <gi...@apache.org> on 2023/02/16 14:34:08 UTC

[GitHub] [airflow] Abhishek-kumar-samsung commented on a diff in pull request #29377: Migrated email and generic transfer operators tests to `pytest`

Abhishek-kumar-samsung commented on code in PR #29377:
URL: https://github.com/apache/airflow/pull/29377#discussion_r1108556732


##########
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:
   Yes when target_lower>target_upper, then some error was coming with the same issue that target_lower>target_upper.
   
   I don't know why with subTests this error was not coming.
   
   So i thought it was some error as lower time should be smaller.
   
   Did i missed something?
   
   Earlier one was correct? or i did wrong on making target_lower greater?
   
   @Taragolis 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org