Skip to content

Commit

Permalink
Fine-tune warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
pekkaklarck committed Sep 15, 2022
1 parent 95881a2 commit 7288cdd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions atest/robot/keywords/keyword_namespaces.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Keyword From Resource Overrides Keywords From Libraries
Keyword From Test Case File Overriding Local Keyword In Resource File Is Deprecated
${tc} = Check Test Case ${TEST NAME}
${message} = Catenate
... Keyword 'my_resource_1.Use test case file keyword even when local keyword with same name exists' called
... keyword 'Keyword Everywhere' that exist both in the same resource file and in the test case file using
... that resource. The keyword in the test case file is used now, but this will change in Robot Framework 6.0.
... Keyword 'my_resource_1.Use test case file keyword even when local keyword with same name exists' called keyword
... 'Keyword Everywhere' that exists both in the same resource file as the caller and in the suite file using that
... resource. The keyword in the suite file is used now, but this will change in Robot Framework 6.0.
Check Log Message ${tc.body[0].body[0].msgs[0]} ${message} WARN
Check Log Message ${ERRORS}[1] ${message} WARN

Expand Down
8 changes: 4 additions & 4 deletions src/robot/running/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ def _get_runner_from_suite_file(self, name):
if caller and runner.source != caller.source:
if self._exists_in_resource_file(name, caller.source):
message = (
f"Keyword '{caller.longname}' called keyword '{name}' that "
f"exist both in the same resource file and in the test case "
f"file using that resource. The keyword in the test case file "
f"is used now, but this will change in Robot Framework 6.0."
f"Keyword '{caller.longname}' called keyword '{name}' that exists "
f"both in the same resource file as the caller and in the suite "
f"file using that resource. The keyword in the suite file is used "
f"now, but this will change in Robot Framework 6.0."
)
runner.pre_run_messages += Message(message, level='WARN'),
return runner
Expand Down

0 comments on commit 7288cdd

Please sign in to comment.