You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make setup and teardown settable in Keywords object #2302
changed the title [-]Make setup and teardown attributes settable in visitor object[/-][+]Make setup and teardown settable in `Keywords` object accessible for pre-run modifiers[/+]on Jun 3, 2016
changed the title [-]Make setup and teardown settable in `Keywords` object accessible for pre-run modifiers[/-][+]Make setup and teardown settable in `Keywords` object[/+]on Jun 3, 2016
It's already possible to alter keywords, including setups and teardowns, but having setup/teardown directly settable is useful. I consider this pretty low priority anyway because it adds no new functionality.
It is nice to assign a keyword to these properties, but I have a question. The unit tests are creating Keyword instances using from robot.model.keyword.Keyword. But this class is not part of the public API. Is there an example that uses only the public API or is the Keyword class now considered public?
Good point @ombre42. The initial use case was removing setup/teardown by setting them to None and at least I didn't think how setting to new keyword would actually work in practice.
Unit tests use model.Keyword, but in real life you probably should use either running.Keyword or result.Keyword. I don't think exposing them via the robot.api would be a good idea because we should then also expose other related classes (e.g. TestCase) and most of these classes have same names.
These classes themselves have already been part of the public API indirectly via the exposed ExecutionResult and TestSuiteBuilder entry points that produce them. Now the question is mainly what is the best way to import them. I would say robot.running/result.Keyword/TestCase/TestSuite are all fine. They are all already exposed like that (at least in 3.0) and should just clarify this usage in the API docs.
Activity
[-]Make setup and teardown attributes settable in visitor object[/-][+]Make setup and teardown settable in `Keywords` object accessible for pre-run modifiers[/+][-]Make setup and teardown settable in `Keywords` object accessible for pre-run modifiers[/-][+]Make setup and teardown settable in `Keywords` object[/+]pekkaklarck commentedon Jun 3, 2016
It's already possible to alter keywords, including setups and teardowns, but having setup/teardown directly settable is useful. I consider this pretty low priority anyway because it adds no new functionality.
ombre42 commentedon Jun 30, 2016
It is nice to assign a keyword to these properties, but I have a question. The unit tests are creating Keyword instances using from robot.model.keyword.Keyword. But this class is not part of the public API. Is there an example that uses only the public API or is the Keyword class now considered public?
pekkaklarck commentedon Jul 5, 2016
Good point @ombre42. The initial use case was removing setup/teardown by setting them to
Noneand at least I didn't think how setting to new keyword would actually work in practice.Unit tests use
model.Keyword, but in real life you probably should use eitherrunning.Keywordorresult.Keyword. I don't think exposing them via therobot.apiwould be a good idea because we should then also expose other related classes (e.g.TestCase) and most of these classes have same names.These classes themselves have already been part of the public API indirectly via the exposed
ExecutionResultandTestSuiteBuilderentry points that produce them. Now the question is mainly what is the best way to import them. I would sayrobot.running/result.Keyword/TestCase/TestSuiteare all fine. They are all already exposed like that (at least in 3.0) and should just clarify this usage in the API docs.