Yelp / Testify

A more pythonic testing framework.
Other
304 stars 67 forks source link

Support for tags on test classes and methods #341

Closed bchess closed 7 years ago

bchess commented 7 years ago

Tags can be applied to a method or class using the @tag(name, value) decorator.

A tag consists of a name and value, both strings. Testify consolidates all of the tag values for each tag name. You can view tags by using the TestCase.tags() method or via testify --list-tests --list-tests-format json

asottile commented 7 years ago

How is this different from @T.suite(..., ...)

bchess commented 7 years ago

Yeah I envision that suites could be a special case of this. Suites have their own meaning that's separate from what we're trying to accomplish (COREBACK-1136)

@suite('integration') could be syntactic sugar for

@tag('suite', 'integration') I don't have a great idea of how reason would fit tho. Aside from just stashing them in their own tag key. Do we actually need reason in code, vs just a comment?

bchess commented 7 years ago

set literals and docstring formatting fixed

asottile commented 7 years ago

To me it seems like you could accomplish your internal goals entirely with the suite decorator @T.suite('depends-on-www_pages') for instance

I'd like to see suites factored out for this to be merged, as written there's two almost-identical things and I'm not convinced tags are needed.

I'm also concerned that there isn't an equivalent for what's being written in pytest and that this doesn't translate well if one were to attempt to port.