[pytest-dev] More flexibility on test function naming conventions

Ernesto D. Luzon Jr. edluzonjr at gmail.com
Fri Jan 8 12:30:26 EST 2016


Hi All,

Is there a way to specify multiple naming conventions for test functions?

For example, in my pytest.ini, I would like:

[pytest]
python_functions=[given, when, then, and, but]


Then pytest can discover functions such as:

def given_iam_an_author(): pass
def and_i_wrote_an_article(): pass
def when_i_do_this(): pass
def then_result_is_good(): pass

If this functionality doesn't exist yet, any hint on which pytest code I
can play with to experiment on this?

Many thanks,
Ernesto D. Luzon Jr.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160108/df85a69d/attachment.html>


More information about the pytest-dev mailing list