This is an automated email from the ASF dual-hosted git repository.
taragolis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 3f6b5574c6 Migrated remaining google cloud operators to pytest (#30177)
3f6b5574c6 is described below
commit 3f6b5574c61ef9765d077bdd08ccdaba14013e4a
Author: Abhishek-kumar-samsung <[email protected]>
AuthorDate: Sat Mar 18 20:01:09 2023 +0530
Migrated remaining google cloud operators to pytest (#30177)
* migrated remaining google cloud operators to pytest
* refactored static checks
---
tests/providers/google/cloud/operators/test_cloud_base.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/tests/providers/google/cloud/operators/test_cloud_base.py
b/tests/providers/google/cloud/operators/test_cloud_base.py
index bb4fc29f7c..c40e2d431f 100644
--- a/tests/providers/google/cloud/operators/test_cloud_base.py
+++ b/tests/providers/google/cloud/operators/test_cloud_base.py
@@ -18,7 +18,6 @@
from __future__ import annotations
import copy
-import unittest
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
from google.api_core.retry import Retry
@@ -40,17 +39,17 @@ class GoogleSampleOperator(GoogleCloudBaseOperator):
self.config = config
-class TestGoogleCloudBaseOperator(unittest.TestCase):
+class TestGoogleCloudBaseOperator:
def test_handles_deepcopy_with_method_default(self):
op = GoogleSampleOperator(task_id=TASK_ID)
copied_op = copy.deepcopy(op)
- self.assertEqual(copied_op.retry, DEFAULT)
- self.assertEqual(copied_op.config, None)
+ assert copied_op.retry == DEFAULT
+ assert copied_op.config is None
def test_handles_deepcopy_with_non_default_retry(self):
op = GoogleSampleOperator(task_id=TASK_ID, retry=Retry(deadline=30),
config={"config": "value"})
copied_op = copy.deepcopy(op)
- self.assertEqual(copied_op.retry.deadline, 30)
- self.assertEqual(copied_op.config, {"config": "value"})
+ assert copied_op.retry.deadline == 30
+ assert copied_op.config == {"config": "value"}