Resolve deprecations in `slack` provider tests (#39518)
diff --git a/tests/deprecations_ignore.yml b/tests/deprecations_ignore.yml
index 87bc17a..21fd165 100644
--- a/tests/deprecations_ignore.yml
+++ b/tests/deprecations_ignore.yml
@@ -668,7 +668,6 @@
- tests/providers/sftp/operators/test_sftp.py::TestSFTPOperator::test_json_file_transfer_put
- tests/providers/sftp/operators/test_sftp.py::TestSFTPOperator::test_pickle_file_transfer_get
- tests/providers/sftp/operators/test_sftp.py::TestSFTPOperator::test_pickle_file_transfer_put
-- tests/providers/slack/operators/test_slack.py::TestSlackAPIFileOperator::test_both_channel_and_channels_set
- tests/providers/snowflake/operators/test_snowflake.py::TestSnowflakeOperator::test_snowflake_operator
- tests/providers/snowflake/operators/test_snowflake.py::TestSnowflakeOperatorForParams::test_overwrite_params
- tests/providers/snowflake/operators/test_snowflake_sql.py::test_exec_success
diff --git a/tests/providers/slack/operators/test_slack.py b/tests/providers/slack/operators/test_slack.py
index ce9a96a..603cef7 100644
--- a/tests/providers/slack/operators/test_slack.py
+++ b/tests/providers/slack/operators/test_slack.py
@@ -302,13 +302,18 @@
def test_both_channel_and_channels_set(self):
error_message = r"Cannot set both arguments: channel=.* and channels=.*\."
+ warning_message = (
+ r"Argument `channel` is deprecated and will removed in a future releases\. "
+ r"Please use `channels` instead\."
+ )
with pytest.raises(ValueError, match=error_message):
- SlackAPIFileOperator(
- task_id="slack",
- slack_conn_id=SLACK_API_TEST_CONNECTION_ID,
- channel="#random",
- channels="#general",
- )
+ with pytest.warns(AirflowProviderDeprecationWarning, match=warning_message):
+ SlackAPIFileOperator(
+ task_id="slack",
+ slack_conn_id=SLACK_API_TEST_CONNECTION_ID,
+ channel="#random",
+ channels="#general",
+ )
@pytest.mark.db_test
@pytest.mark.parametrize(