diff --git a/setup.cfg b/setup.cfg index 6007aec280..aa49d0fd4f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,8 +33,6 @@ addopts = markers = cloud:Run the cloud tests for example filterwarnings = - # error out on our deprecation warnings - ensures the code and tests are kept up-to-date - error::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning error::FutureWarning xfail_strict = true junit_duration_report = call diff --git a/tests/tests_lite/conftest.py b/tests/tests_lite/conftest.py index 952d32e4a9..c38d93ff24 100644 --- a/tests/tests_lite/conftest.py +++ b/tests/tests_lite/conftest.py @@ -144,3 +144,10 @@ def pytest_collection_modifyitems(items: List[pytest.Function], config: pytest.C bold=True, purple=True, # oh yeah, branded pytest messages ) + + # error out on our deprecation warnings - ensures the code and tests are kept up-to-date + deprecation_error = pytest.mark.filterwarnings( + "error::lightning_lite.utilities.rank_zero.LightningDeprecationWarning", + ) + for item in items: + item.add_marker(deprecation_error) diff --git a/tests/tests_pytorch/conftest.py b/tests/tests_pytorch/conftest.py index 252837889f..725953d992 100644 --- a/tests/tests_pytorch/conftest.py +++ b/tests/tests_pytorch/conftest.py @@ -260,6 +260,13 @@ def pytest_collection_modifyitems(items: List[pytest.Function], config: pytest.C purple=True, # oh yeah, branded pytest messages ) + # error out on our deprecation warnings - ensures the code and tests are kept up-to-date + deprecation_error = pytest.mark.filterwarnings( + "error::lightning_lite.utilities.rank_zero.LightningDeprecationWarning", + ) + for item in items: + item.add_marker(deprecation_error) + def pytest_addoption(parser): parser.addoption("--hpus", action="store", type=int, default=1, help="Number of hpus 1-8")