You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2024/05/07 10:58:55 UTC
[PR] Replace `RemovedInAirflow3Warning` by `DeprecationWarning` in warnings captures test dags [airflow]
Taragolis opened a new pull request, #39460:
URL: https://github.com/apache/airflow/pull/39460
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
[Originally](https://github.com/apache/airflow/pull/39109) this test raise `RemovedInAirflow3Warning` which might have a side effect in the other tests which are loaded entire test dag folder, replace it for something which we do not prohibit in our tests.
It also should fix one case (`tests/cli/commands/test_dag_command.py::TestCliDags::test_backfill_treat_dag_as_regex_deprecation`) in https://github.com/apache/airflow/pull/39450 which started failed due to changes in [pytest.warns](https://docs.pytest.org/en/stable/reference/reference.html#pytest-warns) in 8.0, it now reraise unmatched warnings in the end of context manager
```console
❯ pytest tests/cli/commands/test_dag_command.py::TestCliDags::test_backfill_treat_dag_as_regex_deprecation
====================================================================================================== test session starts ======================================================================================================
platform linux -- Python 3.9.9, pytest-8.2.0, pluggy-1.5.0 -- /home/taragolis/.pyenv/versions/3.9.9/envs/airflow-env/bin/python3.9
cachedir: .pytest_cache
rootdir: /home/taragolis/Projects/common/airflow
configfile: pyproject.toml
plugins: mock-3.12.0, rerunfailures-12.0, anyio-4.0.0, time-machine-2.13.0, asyncio-0.21.1, forked-1.4.0, icdiff-0.8, timeouts-1.2.1, instafail-0.5.0, xdist-3.3.1, cov-4.1.0, requests-mock-1.11.0, httpx-0.21.3
asyncio: mode=strict
setup timeout: 0.0s, execution timeout: 0.0s, teardown timeout: 0.0s
collected 1 item
tests/cli/commands/test_dag_command.py::TestCliDags::test_backfill_treat_dag_as_regex_deprecation PASSED [100%]
============================================================================================= Warning summary. Total: 8, Unique: 2 ==============================================================================================
tests: total 8, unique 2
runtest: total 8, unique 2
Warnings saved into /home/taragolis/Projects/common/airflow/tests/warnings.txt file.
======================================================================================================= 1 passed in 4.06s =======================================================================================================
```
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace `RemovedInAirflow3Warning` by `DeprecationWarning` in warnings captures test dags [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis merged PR #39460:
URL: https://github.com/apache/airflow/pull/39460
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org