vendredi 25 décembre 2015

What is the use of conftest.py files?

I recently discovered py.test. It seems great. However I feel the documentation could be better.

I'm trying to understand what conftest.py files are meant to be used for.

In my (currently small) test suite I have one conftest.py file at the project root. I use it to define the fixtures that I inject into my tests.

I have two questions:

  1. Is this the correct use of conftest.py? Does it have other uses?
  2. Can I have more than one conftest.py file? When would I want to do that? Examples will be appreciated.

Aucun commentaire:

Enregistrer un commentaire