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

Formatters: allow steps.usage to select what to print #1090

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djasa
Copy link

@djasa djasa commented Mar 8, 2023

For testing of behave repository itself, it'd be useful to have formatters that would report just faulty steps. The steps.usage formatter now read 'steps.usage.classes' user config key and if it's content is comma-separated list of (used|unused|undefined). If it is not recognized this way, all the step classes are printed to maintain the present behaviour for user who could already depend on this very key.

Example usage:
$ behave --dry -f steps.usage -D steps.usage.classes=unused,undefined

For testing of behave repository itself, it'd be useful to have
formatters that would report just faulty steps. The steps.usage
formatter now read 'steps.usage.classes' user config key and if it's
content is comma-separated list of (used|unused|undefined). If it is not
recognized this way, all the step classes are printed to maintain the
present behaviour for user who could already depend on this very key.

Example usage:
$ behave --dry -f steps.usage -D steps.usage.classes=unused,undefined
@djasa
Copy link
Author

djasa commented Mar 8, 2023

Alternative to #1089. Example use is there.

The part that I don't really like is a usage of -D/config.userdata. In the parser however, I didn't see any generic infrastructure that could be used for per-formatter configs and I didn't want to hardcode the options in --junit-directory style.

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.

None yet

1 participant