worker_id fixture as shown in #47

This commit is contained in:
hellmanj
2016-02-23 17:56:41 -05:00
parent a11632b5d0
commit 7f8ae3944c
3 changed files with 37 additions and 0 deletions

View File

@@ -185,6 +185,16 @@ at once. The specifications strings use the `xspec syntax`_.
.. _`execnet`: http://codespeak.net/execnet
Identifying the worker process during a test
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If you need to determine the identity of a worker process in
a test or fixture, you may use the ``worker_id`` fixture to do so::
@pytest.fixture()
def user_account(worker_id):
""" use a different account in each xdist worker """
return "account_%s" % worker_id
Specifying test exec environments in an ini file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++