Use past tense in messages for already invalidated deprecated configs (#36591)
This commit is contained in:
parent
29838ce1ed
commit
29b8f76e57
2 changed files with 8 additions and 6 deletions
|
@ -659,7 +659,7 @@ def deprecated(
|
|||
warning = (
|
||||
"The '{key}' option is deprecated,"
|
||||
" please replace it with '{replacement_key}'."
|
||||
" This option will become invalid in version"
|
||||
" This option {invalidation_status} invalid in version"
|
||||
" {invalidation_version}"
|
||||
)
|
||||
elif replacement_key:
|
||||
|
@ -671,7 +671,7 @@ def deprecated(
|
|||
warning = (
|
||||
"The '{key}' option is deprecated,"
|
||||
" please remove it from your configuration."
|
||||
" This option will become invalid in version"
|
||||
" This option {invalidation_status} invalid in version"
|
||||
" {invalidation_version}"
|
||||
)
|
||||
else:
|
||||
|
@ -690,6 +690,7 @@ def deprecated(
|
|||
warning.format(
|
||||
key=key,
|
||||
replacement_key=replacement_key,
|
||||
invalidation_status="became",
|
||||
invalidation_version=invalidation_version,
|
||||
)
|
||||
)
|
||||
|
@ -702,6 +703,7 @@ def deprecated(
|
|||
warning,
|
||||
key=key,
|
||||
replacement_key=replacement_key,
|
||||
invalidation_status="will become",
|
||||
invalidation_version=invalidation_version,
|
||||
)
|
||||
|
||||
|
|
|
@ -642,8 +642,8 @@ def test_deprecated_with_invalidation_version(caplog, schema, version):
|
|||
invalidated_schema(test_data)
|
||||
assert str(exc_info.value) == (
|
||||
"The 'mars' option is deprecated, "
|
||||
"please remove it from your configuration. This option will "
|
||||
"become invalid in version 0.1.0"
|
||||
"please remove it from your configuration. This option became "
|
||||
"invalid in version 0.1.0"
|
||||
)
|
||||
|
||||
|
||||
|
@ -702,7 +702,7 @@ def test_deprecated_with_replacement_key_and_invalidation_version(
|
|||
invalidated_schema(test_data)
|
||||
assert str(exc_info.value) == (
|
||||
"The 'mars' option is deprecated, "
|
||||
"please replace it with 'jupiter'. This option will become "
|
||||
"please replace it with 'jupiter'. This option became "
|
||||
"invalid in version 0.1.0"
|
||||
)
|
||||
|
||||
|
@ -851,7 +851,7 @@ def test_deprecated_with_replacement_key_invalidation_version_default(
|
|||
invalidated_schema(test_data)
|
||||
assert str(exc_info.value) == (
|
||||
"The 'mars' option is deprecated, "
|
||||
"please replace it with 'jupiter'. This option will become "
|
||||
"please replace it with 'jupiter'. This option became "
|
||||
"invalid in version 0.1.0"
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue