Thanks Raphael,

    It is almost the thing that I want, however, I would like to be able to
pass a tuple/list to pytest_functions.
    This way, I think, will allow me to instruct pytest to collect specific
set of function prefixes without the need to end all my test functions with
a specific suffix.
    So instead of python_functions=*_check, something
like python_functions=[given, when, then, and, but] would be more desirable.


Thanks Dj,

     I am also aware of pytest-bdd plugin, however, I think my particular
case can not be handled with this plugin.
     To demonstrate further, I created this example BDD test written in
Jupyter.

https://github.com/ldiary/marigoso/blob/master/notes/an_example_of_using_jupyter_for_documenting_and_automating_bdd_style_tests.ipynb

     My future plan is to write a pytest plugin that can discover and run
tests written like these in Jupyter, but I am just a novice python
programmer so I want to start small steps by first writing a script that
can copy and paste these into test functions pytest can collect.

Many thanks,
Ernesto D. Luzon Jr.


On Fri, Jan 8, 2016 at 9:49 PM, Dj Gilcrease <[email protected]> wrote:

> You may also want to look at
>
> https://github.com/pytest-dev/pytest-bdd
>
>
>
> On Fri, Jan 8, 2016 at 9:47 AM Raphael Pierzina <[email protected]>
> wrote:
>
>> Hi Ernesto,
>>
>> maybe this is what you are looking for
>> https://pytest.org/latest/customize.html#confval-python_functions
>>
>> hth
>> Raphael
>>
>> On 08 Jan 2016, at 17:30, Ernesto D. Luzon Jr. <[email protected]>
>> wrote:
>>
>> 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.
>> _______________________________________________
>> pytest-dev mailing list
>> [email protected]
>> https://mail.python.org/mailman/listinfo/pytest-dev
>>
>>
>> _______________________________________________
>> pytest-dev mailing list
>> [email protected]
>> https://mail.python.org/mailman/listinfo/pytest-dev
>>
>
_______________________________________________
pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to