December 9th, 2016


Passing fixtures to test in pytest

Грамманаци саммонятся. Знатоки python/pytest призываются.

I’m working on project which uses pytest to run testinfra tests against cloud instances. Those tests should have information about servers they ought to test (IP address and credentials is a bare minimum).

After some thoughts I decided to create fixture(s) with all relevant information. The question I stumble was ‘how to pass it to pytest’? One of possible solutions is provided below.

Collapse )