Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to solve print function log without mark @keyword #166

Open
jackwucn opened this issue Jan 17, 2024 · 2 comments
Open

is there a way to solve print function log without mark @keyword #166

jackwucn opened this issue Jan 17, 2024 · 2 comments

Comments

@jackwucn
Copy link

Thanks for this great work.
but mark every function with @Keyword is really boring. is there a way to print keyword info without mark @Keyword.
every function can be recognize as keyword default

@DetachHead
Copy link
Owner

the problem with making every function a keyword is that most function calls are internal code that you would never want to see in the robot log. for example, the info function from robot.api.logger would fill the log with keywords for all of the internal robot functions in its implementation.

additionally, implementing such a change would be quite difficult, since it would need to somehow wrap every single function in every module dynamically at runtime.

if i updated the pytest_robotframework.keywordify function to allow you to keywordify every function in an individual module, would that help with your use case? for example:

# conftest.py

import some_module

keywordify(some_module)
# test_foo.py

from some_module import foo, bar

def test_foo():
    """both these function calls will show up as keywords in the robot log"""
    foo()
    bar()

@jackwucn
Copy link
Author

thanks for you advice. I write a method to traverse the directory and import all the modules and methods in conftest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants