[TIP] How to use same pytest hook at module and function scopes?
nicoddemus at gmail.com
Wed Feb 8 11:42:44 PST 2017
On Wed, Feb 8, 2017 at 5:36 PM arun kali raja <arunsep886 at gmail.com> wrote:
> Each of the test.py has its own common_configuration function definition
> and TCs..(test.py won't have any class def)
> My Conftest.py will be in BaseFolder/
> So if these two fixtures would go into the conftest.py can they still call
> the common_configuration function.?
You can use the "request" fixture to obtain the module object and then call
the common_configuration from there:
"request.module" here will be each "test.py" module.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python