dstandish commented on code in PR #39513:
URL: https://github.com/apache/airflow/pull/39513#discussion_r1602046052


##########
tests/providers/smtp/notifications/test_smtp.py:
##########
@@ -129,7 +133,7 @@ def test_notifier_with_defaults(self, mock_smtphook_hook, 
create_task_instance):
             from_email=conf.get("smtp", "smtp_mail_from"),
             to="[email protected]",
             subject="DAG dag - Task op - Run ID test in State None",
-            html_content="""<!DOCTYPE html>\n<html>\n    <head>\n        <meta 
http-equiv="Content-Type" content="text/html; charset=utf-8" />\n        <meta 
name="viewport" content="width=device-width">\n    </head>\n<body>\n    <table 
role="presentation">\n        \n        <tr>\n            <td>Run ID:</td>\n    
        <td>test</td>\n        </tr>\n        <tr>\n            <td>Try:</td>\n 
           <td>0 of 1</td>\n        </tr>\n        <tr>\n            <td>Task 
State:</td>\n            <td>None</td>\n        </tr>\n        <tr>\n           
 <td>Host:</td>\n            <td></td>\n        </tr>\n        <tr>\n           
 <td>Log Link:</td>\n            <td><a 
href="http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs";
 
style="text-decoration:underline;">http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs</a></td>\n
        </tr>\n        <tr>\n            <td>Mark Success Link:</td>\n          
  <td><a href="http:
 
//localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success"
 
style="text-decoration:underline;">http://localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success</a></td>\n
        </tr>\n        \n    </table>\n</body>\n</html>""",
+            html_content=f"""<!DOCTYPE html>\n<html>\n    <head>\n        
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n        
<meta name="viewport" content="width=device-width">\n    </head>\n<body>\n    
<table role="presentation">\n        \n        <tr>\n            <td>Run 
ID:</td>\n            <td>test</td>\n        </tr>\n        <tr>\n            
<td>Try:</td>\n            <td>{NUM_TRY} of 1</td>\n        </tr>\n        
<tr>\n            <td>Task State:</td>\n            <td>None</td>\n        
</tr>\n        <tr>\n            <td>Host:</td>\n            <td></td>\n        
</tr>\n        <tr>\n            <td>Log Link:</td>\n            <td><a 
href="http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs";
 
style="text-decoration:underline;">http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs</a></td>\n
        </tr>\n        <tr>\n            <td>Mark Success Link:</td>\n          
  <td><a hr
 
ef="http://localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success";
 
style="text-decoration:underline;">http://localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success</a></td>\n
        </tr>\n        \n    </table>\n</body>\n</html>""",

Review Comment:
   Hey @potiuk no i don't think this is behavior change.
   
   I think this is this is a result of the fact that in the test, the TI was 
never "scheduled", and therefore TI is not incremented.  
   
   Previously we lied about the try_number (by returning x+1 when non-running) 
and now we tell the truth essentially. 
   
   We could increment the try_number to something else in this test before 
generating the mail, but that would not really change what the test is testing.



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