doc: improve documentaiton about listeters#183
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves PythonLibCore’s listener documentation and adds acceptance-test coverage demonstrating listener auto-detection in keyword component classes, while also tweaking CI Python version matrix formatting.
Changes:
- Added a new README section describing listener support and an example implementation.
- Added a new acceptance-test library (
ListenerExample.py) and a new test case exercising listener behavior. - Updated acceptance test runner to execute the listener-focused suite and adjusted CI Python matrix version formatting.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds listener documentation and an example (needs wording/syntax-highlighting fixes). |
| atest/tests_listener.robot | Imports the new listener example library and adds a new listener-related test case. |
| atest/run.py | Runs the new listener acceptance-test suite and includes its output in the combined results. |
| atest/ListenerExample.py | New acceptance-test library demonstrating a component class acting as a listener. |
| atest/ListenerCore.py | Updates assertion error messages for listener-related acceptance tests. |
| .github/workflows/CI.yml | Adjusts Python version matrix formatting (string versions / minor versions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+161
to
+165
| PLC supports | ||
| [library listeners](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#libraries-as-listeners), | ||
| also listener can be defined in the class that defines keywords. PLC will automatically detect | ||
| is class is also listener and set the `ROBOT_LIBRARY_LISTENER` as a list. List will contains all | ||
| the class instances that are marked as listeners. |
| the class instances that are marked as listeners. | ||
|
|
||
| Example: | ||
| ```robotframework |
Comment on lines
+204
to
+205
| In the example `KeywordsWithListener` will act as a listener and `start_test` method is | ||
| called each time test starts. |
Comment on lines
+161
to
+165
| PLC supports | ||
| [library listeners](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#libraries-as-listeners), | ||
| also listener can be defined in the class that defines keywords. PLC will automatically detect | ||
| is class is also listener and set the `ROBOT_LIBRARY_LISTENER` as a list. List will contains all | ||
| the class instances that are marked as listeners. |
Comment on lines
+9
to
+15
| ROBOT_LIBRARY_SCOPE = 'GLOBAL' | ||
| ROBOT_LISTENER_API_VERSION = 3 | ||
|
|
||
| def __init__(self): | ||
| self.ROBOT_LIBRARY_LISTENER = self | ||
| components = [KeywordsWithListener()] | ||
| super().__init__(components) |
Comment on lines
+22
to
+24
| def __init__(self): | ||
| self.test = None | ||
|
|
Comment on lines
213
to
216
| is not mandatory to provide translation to all keyword. | ||
|
|
||
| The keys of the dictionary are the methods names, not the keyword names, which implements keyword. | ||
| The keys of the dictionary are the methods names, not the keyword names, which implements keyword. | ||
| Values are objects which contains two keys: `name` and `doc`. `name` key contains the keyword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.