Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

py.test: specifying python_files in the command line

I want to set the argument python_files in pytest. The documentation says you need to put it in a configuration file, but I want to include it in the command line as part of the call to py.test, so I won't have to add that configuration file. Is that possible?

like image 216
Ram Rachum Avatar asked Jan 14 '16 23:01

Ram Rachum


1 Answers

It is not possible with pytest out of the box as it is now (2.8). The pytest parser knows about command-line options (addoption/getoption) and config file values (addini/getini) but they are quite separate.

It is probably possible to write a plugin to add python_files (or any other ini value) as a command-line option. But just adding a conftest file is certainly the simpler option.

like image 105
pfctdayelise Avatar answered Oct 21 '22 11:10

pfctdayelise