Add tagging separate from string descriptions
See original GitHub issueThere is a clear distinction between describing a test and classifying it. They are semantically different things. The current method of ‘tagging’ or ‘marking’ tests is by patterns in the string descriptions. This not only mixes two things that probably shouldn’t be but also causes some usability issues.
Even just a couple ‘tags’ can drown out the test descriptions, especially since they have to be formatted for reliable parsing for text search. They don’t end up looking great in the output as the tags don’t line up for easy human parsing. As alluded to before, text searching is clunky at best or unreliable.
So, I suggest adding a tags
or similar attribute to tests and parameter to the test
decorator to supplant the idea of tagging the descriptions. The --search
CLI option could remain for text searching the descriptions, but a new --tags
(or whatever name is chosen) option could be added. An implementation detail that would need to be ironed out is whether to support both ‘or’ and ‘and’ cases as well as how for multiple tags.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:12 (12 by maintainers)
Top GitHub Comments
+
being used in tags common enough to want to spare it. And I don’t think it looks as good./
is even more likely to be used than+
.&
would require shell escaping, which isn’t great. That’s one of the reasons I dislike your initial syntax suggestion.CLI syntax is too simple for an absolutely perfect analogue for this complexity, which isn’t even that complex. So, a bit of stretching is going to be necessary. I’d love to hear others’ thoughts, opinions, or suggestions.
I haven’t really had much need for an exclude, but I can definitely see that being desired. That could easily share the same design as the
--tags
option with an added condition like:Tagging tests and querying those tags using tag expressions has been released as part of Ward 0.42.0b0, which is now on PyPI.