Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming nose compatible methods in flavour of regular pytest naming #29035

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ addopts =
--verbosity=2
; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
-p no:flaky
; Disable `nose` builtin plugin for pytest. This feature deprecated in 7.2 and will be removed in pytest>=8
; And we focus on use native pytest capabilities rather than adopt another frameworks.
-p no:nose
norecursedirs =
.eggs
airflow
Expand Down
2 changes: 1 addition & 1 deletion tests/api/common/test_mark_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def create_dags(cls, dagbag):
]

@pytest.fixture(autouse=True)
def setup(self):
def setup_tests(self):

clear_db_runs()
drs = _create_dagruns(
Expand Down
10 changes: 6 additions & 4 deletions tests/providers/amazon/aws/hooks/test_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@
DEFAULT_VALUE = "default"


@mock_ssm
class TestSsmHooks:
def setup(self):
self.hook = SsmHook(region_name=REGION)
self.hook.conn.put_parameter(Name=EXISTING_PARAM_NAME, Value=PARAM_VALUE, Overwrite=True)
@pytest.fixture(autouse=True)
def setup_tests(self):
with mock_ssm():
self.hook = SsmHook(region_name=REGION)
self.hook.conn.put_parameter(Name=EXISTING_PARAM_NAME, Value=PARAM_VALUE, Overwrite=True)
yield

def test_hook(self) -> None:
assert self.hook.conn is not None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def logmock():
class TestCloudwatchTaskHandler:
@conf_vars({("logging", "remote_log_conn_id"): "aws_default"})
@pytest.fixture(autouse=True)
def setup(self, create_log_template, tmp_path_factory):
def setup_tests(self, create_log_template, tmp_path_factory):
self.remote_log_group = "log_group_name"
self.region_name = "us-west-2"
self.local_log_location = str(tmp_path_factory.mktemp("local-cloudwatch-log-location"))
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/amazon/aws/log/test_s3_task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def s3mock():
class TestS3TaskHandler:
@conf_vars({("logging", "remote_log_conn_id"): "aws_default"})
@pytest.fixture(autouse=True)
def setup(self, create_log_template, tmp_path_factory):
def setup_tests(self, create_log_template, tmp_path_factory):
self.remote_log_base = "s3://bucket/remote/log/location"
self.remote_log_location = "s3://bucket/remote/log/location/1.log"
self.remote_log_key = "remote/log/location/1.log"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def create_context(task, persist_to_db=False, map_index=None):
@pytest.mark.execution_timeout(300)
class TestKubernetesPodOperator:
@pytest.fixture(autouse=True)
def setup(self, dag_maker):
def setup_tests(self, dag_maker):
self.create_pod_patch = patch(f"{POD_MANAGER_CLASS}.create_pod")
self.await_pod_patch = patch(f"{POD_MANAGER_CLASS}.await_pod_start")
self.await_pod_completion_patch = patch(f"{POD_MANAGER_CLASS}.await_pod_completion")
Expand Down