Files
pytest2/doc/test/config.txt
holger krekel d9ad2cf761 merging the new function generators, addresses issue 2
- introduce a new pytest_genfuncruns hook for generating tests with multiple funcargs
- new and extended docs: doc/test/funcargs.txt
- factor all funcargs related code into py/test/funcargs.py
- remove request.maketempdir call (you can use request.config.mktemp)

--HG--
branch : trunk
2009-05-11 19:23:57 +02:00

49 lines
1.4 KiB
Plaintext

Test configuration
========================
test options and values
-----------------------------
You can see all available command line options by running::
py.test -h
py.test will lookup values of options in this order:
* option value supplied at command line
* content of environment variable ``PYTEST_OPTION_NAME=...``
* ``name = ...`` setting in the nearest ``conftest.py`` file.
The name of an option usually is the one you find
in the longform of the option, i.e. the name
behind the ``--`` double-dash.
IOW, you can set default values for options per project, per
home-directoray, per shell session or per test-run.
.. _`basetemp`:
per-testrun temporary directories
-------------------------------------------
``py.test`` runs provide means to create per-test session
temporary (sub) directories through the config object.
You can create directories like this:
.. XXX use a more local example, just with "config"
.. sourcecode: python
import py
basetemp = py.test.config.ensuretemp()
basetemp_subdir = py.test.config.ensuretemp("subdir")
By default, ``py.test`` creates a ``pytest-NUMBER`` directory
and will keep around the directories of the last three
test runs. You can also set the base temporary directory
with the `--basetemp`` option. When distributing
tests on the same machine, ``py.test`` takes care to
pass around the basetemp directory such that all temporary
files land below the same basetemp directory.