deedmitrij commented on a change in pull request #19014:
URL: https://github.com/apache/airflow/pull/19014#discussion_r730077161



##########
File path: tests/providers/google/cloud/operators/test_cloud_sql_system.py
##########
@@ -34,27 +35,98 @@
 from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, 
GoogleSystemTest, provide_gcp_context
 
 GCP_PROJECT_ID = os.environ.get('GCP_PROJECT_ID', 'project-id')
+CLOUD_SQL_BUCKET_NAME = os.environ.get('CLOUD_SQL_BUCKET_NAME', 'INVALID 
BUCKET NAME')
 
 SQL_QUERY_TEST_HELPER = CloudSqlQueryTestHelper()
 
 
[email protected](scope='class')
+def env_patch():
+    """
+    A convenient fixture for environment variables patching.
+    All modifications will be undone after the requesting test class has 
finished.
+    """
+    from _pytest.monkeypatch import MonkeyPatch
+    mpatch = MonkeyPatch()

Review comment:
       @mik-laj I know. Main reason of this change is to have possibility to 
run whole **test_cloud_sql_system.py** file with tests as it is. With existed 
logic you can't do it, because instance name for each test in this file should 
be unique and you can't provide this uniqueness even manually set up 
environment variables. That's why I've added the fixture which generates unique 
postfix and add it to instances names.




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