VishakBaddur opened a new pull request, #77358:
URL: https://github.com/apache/airflow/pull/77358

   pytest 9 deprecates `config.inicfg`, and every test run currently prints:
   
   ```
   PytestRemovedIn10Warning: config.inicfg is deprecated, use config.getini() 
to access configuration values instead.
   ```
   
   `tests_common/pytest_plugin.py` wrote the deprecations ignore file list into 
`config.inicfg` as a fake ini value (built with the private 
`_pytest.config.findpaths.ConfigValue`), only for 
`ForbiddenWarningsPlugin.__init__` to read it back. `getini()` can't replace 
this, since it is read-only and the value is not a real ini option.
   
   This passes the list to `ForbiddenWarningsPlugin`'s constructor instead, the 
same way `CaptureWarningsPlugin` already receives `output_path`, and drops both 
private `ConfigValue` imports.
   
   The `config.inicfg` assignment in `task-sdk/tests/conftest.py` is removed. 
Task SDK tests use `task-sdk/pyproject.toml`, which sets no 
`forbidden_warnings`, so `ForbiddenWarningsPlugin` is never created there and 
the value was never read.
   
   **Before**, with the warning turned into an error (as it will be in pytest 
10), both entry points crash at configure time:
   
   ```
   $ uv run pytest airflow-core/tests/unit/utils/test_helpers.py -W 
error::pytest.PytestRemovedIn10Warning
   INTERNALERROR>   File ".../tests_common/pytest_plugin.py", line 683, in 
pytest_configure
   INTERNALERROR>     config.inicfg["airflow_deprecations_ignore"] = 
ConfigValue(
   INTERNALERROR> pytest.PytestRemovedIn10Warning: config.inicfg is deprecated, 
...
   
   $ uv run pytest task-sdk/tests/task_sdk/test_crypto.py -W 
error::pytest.PytestRemovedIn10Warning
   INTERNALERROR>     config.inicfg["airflow_deprecations_ignore"] = []
   INTERNALERROR> pytest.PytestRemovedIn10Warning: config.inicfg is deprecated, 
...
   ```
   
   **After**: `28 passed` and `9 passed` respectively, with no warnings.
   
   No behavior change:
   - The plugin's resolved `excluded_cases` is identical before and after (171 
entries, same contents) for airflow-core and provider runs; Task SDK runs still 
create no plugin.
   - A test emitting `AirflowProviderDeprecationWarning` still fails.
   - Same results with xdist (`-n 2`), and `airflow-core/tests/unit/utils` 
(serial) has the same pass/fail set before and after.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.


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