Dev-iL opened a new issue, #37587:
URL: https://github.com/apache/airflow/issues/37587

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   A PR was merged with incorrectly defined tests. These should've failed, 
didn't. It's possible that they weren't even evaluated.
   
   ### What you think should happen instead?
   
   The build should've failed, alerting everyone involved about the issue.
   
   ### How to reproduce
   
   ```bash
   airflow$ pytest tests/test_settings.py
   ```
   
   ### Operating System
   
   Ubuntu 22.04
   
   ### Versions of Apache Airflow Providers
   
   Irrelevant
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   Irrelevant
   
   ### Anything else?
   
   This fixes the tests:
   ```python
   @patch("airflow.settings.conf")
   @patch("airflow.settings.is_sqlalchemy_v1")
   def test_encoding_present_in_v1(is_v1, mock_conf):
       is_v1.return_value = True
       mock_conf.getjson.return_value = {}
   
       engine_args = settings.prepare_engine_args()
   
       assert "encoding" in engine_args
   
   
   @patch("airflow.settings.conf")
   @patch("airflow.settings.is_sqlalchemy_v1")
   def test_encoding_absent_on_v2(is_v1, mock_conf):
       is_v1.return_value = False
       mock_conf.getjson.return_value = {}
   
       engine_args = settings.prepare_engine_args()
   
       assert "encoding" not in engine_args
   ```
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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