-
Notifications
You must be signed in to change notification settings - Fork 111
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
Allow index-only test names #81
Conversation
Hello @wswld , are you the right person to ping? If yes, would you please kindly review this PR? Thank you. |
The opposite would also be great, having the option to only use names and ditch indexes entirely. |
Hi @wswld and @skeletorXVI , thanks for reacting to this pull request. I have a medium priority around this change and would like to receive a green light asap so that the next release will have my changes included. My side wants this change because it will allow easier execution of a specific test. Given my below suggestion is okay, I can adjust my code here to leave a room for further changes while I will not have the time to implement extra ways to format test names. For example, instead of using a boolean for the kwargs, I can make that to accept an enum:
In such case, adding other ways to format a test name will be driven by the enum. Does that sound okay? In fact, for @skeletorXVI , what use case you are considering so that you don't want the index? I really appreciate all inputs here and I am looking forward to see further comments from both of you. Thank you. |
I write most of my data-driven unit tests using YAML files. I always name them based on what case they are testing. I am using PyCharm, removing or adding tests the indices change and I have to change all run configurations for the affected tests. I am considering implementing #66 once I have some time to further improve compatibility with PyCharm. |
@zorchan definitely go ahead with adding room for further changes and I will review this ASAP. |
Hi @wswld and @skeletorXVI , a new commit is ready and I also re-ran the tests. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, everything looks good aside from a bunch of documentation and naming-related nitpicks.
A new commit is ready but |
Merged. Thank you for your contribution. |
Hi @wswld , thanks for accepting the change. After releasing 1.4.0, I saw that there are some problems reported by others.
For example:
To decorate a class:
Thank you. |
What: I would like to add a feature to
ddt
so that test names can be generated using just the index only.How: To allow that to happen, I am making use of
kwargs
at the class-level decorator@ddt
. When decorating a class with@ddt(formatTestName=FormatTestName.INDEX_ONLY)
, the boolean value will be passed tomk_test_name()
and test names will just be index-only.Why: An easier way to trigger a specific test to run.
Testing: New unit test added. Using
tox
to run against py27 and py35.