From a5b698ddb9258cc8ec48a22ea1020ff229604f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Kl=C3=A4rck?= Date: Mon, 31 Oct 2022 16:23:54 +0200 Subject: [PATCH] Fix version numbers in docs and in a warning. Fixes #4525. --- atest/robot/tags/-tag_syntax.robot | 2 +- .../src/CreatingTestData/CreatingTestCases.rst | 6 +++--- .../src/CreatingTestData/CreatingUserKeywords.rst | 2 +- .../src/ExecutingTestCases/TestExecution.rst | 1 - src/robot/running/arguments/embedded.py | 11 +++++------ src/robot/running/builder/transformers.py | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/atest/robot/tags/-tag_syntax.robot b/atest/robot/tags/-tag_syntax.robot index 446960b45f0..ed5685688fc 100644 --- a/atest/robot/tags/-tag_syntax.robot +++ b/atest/robot/tags/-tag_syntax.robot @@ -31,6 +31,6 @@ Check Deprecation Warning [Arguments] ${index} ${source} ${lineno} ${tag} Error in file ${index} ${source} ${lineno} ... Settings tags starting with a hyphen using the '[Tags]' setting is deprecated. - ... In Robot Framework 5.2 this syntax will be used for removing tags. + ... In Robot Framework 6.1 this syntax will be used for removing tags. ... Escape '${tag}' like '\\${tag}' to use the literal value and to avoid this warning. ... level=WARN pattern=False diff --git a/doc/userguide/src/CreatingTestData/CreatingTestCases.rst b/doc/userguide/src/CreatingTestData/CreatingTestCases.rst index cba83d6f19b..d28d3344fea 100644 --- a/doc/userguide/src/CreatingTestData/CreatingTestCases.rst +++ b/doc/userguide/src/CreatingTestData/CreatingTestCases.rst @@ -677,10 +677,10 @@ using two different settings: Both of these settings still work, but they are considered deprecated. A visible deprecation warning will be added in the future, most likely -in Robot Framework 6.0, and eventually these settings will be removed. +in Robot Framework 7.0, and eventually these settings will be removed. Tools like Tidy__ can be used to ease transition. -Robot Framework 5.2 will introduce a new way for tests to indicate they +Robot Framework 6.1 will introduce a new way for tests to indicate they `should not get certain globally specified tags`__. Instead of using a separate setting that tests can override, tests can use syntax `-tag` with their :setting:`[Tags]` setting to tell they should not get a tag named `tag`. @@ -689,7 +689,7 @@ This syntax *does not* yet work in Robot Framework 6.0, but using If such tags are needed, they can be set using :setting:`Test Tags` or escaped__ syntax `\-tag` can be used with :setting:`[Tags]`. -__ https://robotidy.readthedocs.io/ +__ https://robotidy.readthedocs.io __ https://github.com/robotframework/robotframework/issues/4374 __ https://github.com/robotframework/robotframework/issues/4380 __ escaping_ diff --git a/doc/userguide/src/CreatingTestData/CreatingUserKeywords.rst b/doc/userguide/src/CreatingTestData/CreatingUserKeywords.rst index 9b9d691614e..a6747c81104 100644 --- a/doc/userguide/src/CreatingTestData/CreatingUserKeywords.rst +++ b/doc/userguide/src/CreatingTestData/CreatingUserKeywords.rst @@ -195,7 +195,7 @@ activating the special functionality. versions all keyword tags need to be specified using the :setting:`[Tags]` setting. -.. note:: Robot Framework 5.2 will support `removing globally set tags`__ using +.. note:: Robot Framework 6.1 will support `removing globally set tags`__ using the `-tag` syntax with the :setting:`[Tags]` setting. Creating tags with literal value like `-tag` `is deprecated`__ in Robot Framework 6.0 and escaped__ syntax `\-tag` must be used if such tags are actually diff --git a/doc/userguide/src/ExecutingTestCases/TestExecution.rst b/doc/userguide/src/ExecutingTestCases/TestExecution.rst index b6d18e86f04..5137e5e07f1 100644 --- a/doc/userguide/src/ExecutingTestCases/TestExecution.rst +++ b/doc/userguide/src/ExecutingTestCases/TestExecution.rst @@ -621,7 +621,6 @@ using signals `INT` and `TERM`. These signals can be sent from the command line using ``kill`` command, and sending signals can also be easily automated. - Using keywords ~~~~~~~~~~~~~~ diff --git a/src/robot/running/arguments/embedded.py b/src/robot/running/arguments/embedded.py index be56a925cbc..1b501430b49 100644 --- a/src/robot/running/arguments/embedded.py +++ b/src/robot/running/arguments/embedded.py @@ -44,13 +44,12 @@ def map(self, values): def validate(self, values): # Validating that embedded args match custom regexps also if args are # given as variables was initially implemented in RF 6.0. It needed - # to be reverted due to backwards incompatibility reasons: + # to be reverted due to backwards incompatibility reasons but the plan + # is to enable it again in RF 7.0: # https://github.com/robotframework/robotframework/issues/4069 # - # We hopefully can add validation back in RF 5.2 or 6.0. A precondition - # is implementing better approach to handle conflicts with keywords - # using embedded arguments: - # https://github.com/robotframework/robotframework/issues/4454 + # TODO: Emit deprecation warnings if patterns don't match in RF 6.1: + # https://github.com/robotframework/robotframework/issues/4524 # # Because the plan is to add validation back, the code was not removed # but the `ENABLE_STRICT_ARGUMENT_VALIDATION` guard was added instead. @@ -65,7 +64,7 @@ def validate(self, values): for arg, value in zip(self.args, values): if arg in self.custom_patterns and is_string(value): pattern = self.custom_patterns[arg] - if not re.match(pattern + '$', value): + if not re.fullmatch(pattern, value): raise ValueError(f"Embedded argument '{arg}' got value '{value}' " f"that does not match custom pattern '{pattern}'.") diff --git a/src/robot/running/builder/transformers.py b/src/robot/running/builder/transformers.py index bdfc775daec..26bc90d82de 100644 --- a/src/robot/running/builder/transformers.py +++ b/src/robot/running/builder/transformers.py @@ -566,7 +566,7 @@ def deprecate_tags_starting_with_hyphen(node, source): LOGGER.warn( f"Error in file '{source}' on line {node.lineno}: " f"Settings tags starting with a hyphen using the '[Tags]' setting " - f"is deprecated. In Robot Framework 5.2 this syntax will be used " + f"is deprecated. In Robot Framework 6.1 this syntax will be used " f"for removing tags. Escape '{tag}' like '\\{tag}' to use the " f"literal value and to avoid this warning." )