Skip to content

Commit

Permalink
Move exception ignore list into forbidden_warnings.py
Browse files Browse the repository at this point in the history
The config files which contain exceptions for forbidden_warnings were
set in pytest config in the conftest files. The plugin is now loaded at
the top-level and before conftest files are. Move the config into the
python module for the plugin itself. There should be no harm in
configuring all exceptions for each test type
  • Loading branch information
o-nikolas committed Oct 24, 2024
1 parent 5e98bc9 commit c71472e
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 223 deletions.
9 changes: 0 additions & 9 deletions providers/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,11 @@

from __future__ import annotations

import pathlib
from unittest import mock

import pytest


@pytest.hookimpl(tryfirst=True)
def pytest_configure(config: pytest.Config) -> None:
dep_path = [pathlib.Path(__file__).parent.joinpath("deprecations_ignore.yml")]
config.inicfg["airflow_deprecations_ignore"] = (
config.inicfg.get("airflow_deprecations_ignore", []) + dep_path # type: ignore[assignment,operator]
)


@pytest.fixture
def hook_conn(request):
"""
Expand Down
128 changes: 0 additions & 128 deletions providers/tests/deprecations_ignore.yml

This file was deleted.

7 changes: 0 additions & 7 deletions task_sdk/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,5 @@

import os

import pytest

# Task SDK does not need access to the Airflow database
os.environ["_AIRFLOW_SKIP_DB_TESTS"] = "true"


@pytest.hookimpl(tryfirst=True)
def pytest_configure(config: pytest.Config) -> None:
config.inicfg["airflow_deprecations_ignore"] = []
8 changes: 0 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
]


@pytest.hookimpl(tryfirst=True)
def pytest_configure(config: pytest.Config) -> None:
dep_path = [config.rootpath.joinpath("tests", "deprecations_ignore.yml")]
config.inicfg["airflow_deprecations_ignore"] = (
config.inicfg.get("airflow_deprecations_ignore", []) + dep_path # type: ignore[assignment,operator]
)


@pytest.fixture
def reset_environment():
"""Resets env variables."""
Expand Down
53 changes: 0 additions & 53 deletions tests/deprecations_ignore.yml

This file was deleted.

Loading

0 comments on commit c71472e

Please sign in to comment.