Use past tense in messages for already invalidated deprecated configs (#36591)

This commit is contained in:
Ville Skyttä 2020-06-10 09:26:55 +03:00 committed by GitHub
parent 29838ce1ed
commit 29b8f76e57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -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,
)

View file

@ -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"
)