[Pytest-commit] Issue #538: Fixture scope documentation (hpk42/pytest)

Mark Stacey issues-reply at bitbucket.org
Fri Jul 4 19:26:17 CEST 2014


New issue 538: Fixture scope documentation
https://bitbucket.org/hpk42/pytest/issue/538/fixture-scope-documentation

Mark Stacey:

The [http://pytest.org/latest/fixture.html](http://pytest.org/latest/fixture.html) briefly mentions the possibility of a fixture with class scope in the beginning summary, but it isn't mentioned anywhere else in the document. I had to check the source code to see if this was possible.


Also, I didn't see any mention that the default scope was "function" - it was implied, but not explicit.


I think it would be helpful to include a full list of available scopes, and to explicitly say that  function scope is default. Both of these things are included in the docstring for the fixture function in the source code:


```
#!python

:arg scope: the scope for which this fixture is shared, one of
                "function" (default), "class", "module", "session".
```




More information about the pytest-commit mailing list