Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Begleco
Copy link

@Begleco Begleco commented Oct 2, 2025

Expanded functionality of "--removekeywords" to also remove keywords with the "NOT RUN" status as per the request in issue #3845.

Copy link
Member

@pekkaklarck pekkaklarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few things to be done:

  • As I mentioned in the separate comment, the current implementation removes keywords only from test body, not from child keywords and control structures.
  • Tests are needed. atest/README.rst explains the test system and I can help here or on the #devel channel on our Slack if you have questions.
  • User Guide documentation is needed. I can help with that as well if needed.

def visit_test(self, test):
before = len(test.body)
test.body = [kw for kw in test.body if kw.status != "NOT RUN"]
self.removal_message.set_to_if_removed(test, before)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only removes keywords from test body, not from child keywords or control structures. The easiest way to extend the functionality would be implementing start_test instead of visit_test (that way also body is visited automatically) and implementing also start_body_item that's, by default, called with all keywords and control structures.

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

Successfully merging this pull request may close these issues.

2 participants