Move logic to error out on deprecation warnings into conftest (#14902)
This commit is contained in:
parent
d1a3a3ebf5
commit
9fc4ff3278
|
@ -33,8 +33,6 @@ addopts =
|
||||||
markers =
|
markers =
|
||||||
cloud:Run the cloud tests for example
|
cloud:Run the cloud tests for example
|
||||||
filterwarnings =
|
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
|
error::FutureWarning
|
||||||
xfail_strict = true
|
xfail_strict = true
|
||||||
junit_duration_report = call
|
junit_duration_report = call
|
||||||
|
|
|
@ -144,3 +144,10 @@ def pytest_collection_modifyitems(items: List[pytest.Function], config: pytest.C
|
||||||
bold=True,
|
bold=True,
|
||||||
purple=True, # oh yeah, branded pytest messages
|
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)
|
||||||
|
|
|
@ -260,6 +260,13 @@ def pytest_collection_modifyitems(items: List[pytest.Function], config: pytest.C
|
||||||
purple=True, # oh yeah, branded pytest messages
|
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):
|
def pytest_addoption(parser):
|
||||||
parser.addoption("--hpus", action="store", type=int, default=1, help="Number of hpus 1-8")
|
parser.addoption("--hpus", action="store", type=int, default=1, help="Number of hpus 1-8")
|
||||||
|
|
Loading…
Reference in New Issue