Remove references to python pre-2.6 from docs

This commit is contained in:
Bruno Oliveira 2015-12-16 16:14:36 -02:00
parent 81588d7f63
commit ec597e81a4
7 changed files with 16 additions and 34 deletions

View File

@ -243,10 +243,9 @@ recording the intermediate values. Which technique is used depends on the
location of the assert, ``pytest`` configuration, and Python version being used
to run ``pytest``.
By default, if the Python version is greater than or equal to 2.6, ``pytest``
rewrites assert statements in test modules. Rewritten assert statements put
introspection information into the assertion failure message. ``pytest`` only
rewrites test modules directly discovered by its test collection process, so
By default, ``pytest`` rewrites assert statements in test modules.
Rewritten assert statements put introspection information into the assertion failure message.
``pytest`` only rewrites test modules directly discovered by its test collection process, so
asserts in supporting modules which are not themselves test modules will not be
rewritten.

View File

@ -234,8 +234,8 @@ For an example on how to add and work with markers from a plugin, see
Marking whole classes or modules
----------------------------------------------------
If you are programming with Python 2.6 or later you may use ``pytest.mark``
decorators with classes to apply markers to all of its test methods::
You may use ``pytest.mark`` decorators with classes to apply markers to all of
its test methods::
# content of test_mark_classlevel.py
import pytest

View File

@ -66,9 +66,8 @@ This completely avoids previous issues of confusing assertion-reporting.
It also means, that you can use Python's ``-O`` optimization without losing
assertions in test modules.
``pytest`` contains a second, mostly obsolete, assert debugging technique,
invoked via ``--assert=reinterpret``, activated by default on
Python-2.5: When an ``assert`` statement fails, ``pytest`` re-interprets
``pytest`` contains a second, mostly obsolete, assert debugging technique
invoked via ``--assert=reinterpret``: When an ``assert`` statement fails, ``pytest`` re-interprets
the expression part to show intermediate values. This technique suffers
from a caveat that the rewriting does not: If your expression has side
effects (better to avoid them anyway!) the intermediate values may not

View File

@ -89,9 +89,7 @@ between test modules so it's no longer advertised as the primary method.
Skip all test functions of a class or module
---------------------------------------------
As with all function :ref:`marking <mark>` you can skip test functions at the
`whole class- or module level`_. If your code targets python2.6 or above you
use the skipif decorator (and any other marker) on classes::
You can use the ``skipif`` decorator (and any other marker) on classes::
@pytest.mark.skipif(sys.platform == 'win32',
reason="does not run on windows")
@ -103,19 +101,6 @@ use the skipif decorator (and any other marker) on classes::
If the condition is true, this marker will produce a skip result for
each of the test methods.
If your code targets python2.5 where class-decorators are not available,
you can set the ``pytestmark`` attribute of a class::
class TestPosixCalls:
pytestmark = pytest.mark.skipif(sys.platform == 'win32',
reason="does not run on windows")
def test_function(self):
"will not be setup or run under 'win32' platform"
As with the class-decorator, the ``pytestmark`` special name tells
``pytest`` to apply it to each test function in the class.
If you want to skip all test functions of a module, you must use
the ``pytestmark`` name on the global level:

View File

@ -126,7 +126,7 @@ Specifying test exec environments in a conftest.py
Instead of specifying command line options, you can
put options values in a ``conftest.py`` file like this::
option_tx = ['ssh=myhost//python=python2.5', 'popen//python=python2.5']
option_tx = ['ssh=myhost//python=python2.7', 'popen//python=python2.7']
option_dist = True
Any commandline ``--tx`` specifications will add to the list of
@ -163,7 +163,7 @@ command line options
(default) no: run tests inprocess, don't distribute.
``--tx=xspec``
add a test execution environment. some examples: --tx popen//python=python2.5 --tx socket=192.168.1.102:8888 --tx ssh=user@codespeak.net//chdir=testcache
add a test execution environment. some examples: --tx popen//python=python2.7 --tx socket=192.168.1.102:8888 --tx ssh=user@codespeak.net//chdir=testcache
``-d``
load-balance tests. shortcut for '--dist=load'
``--rsyncdir=dir1``

View File

@ -12,8 +12,7 @@ Calling pytest through ``python -m pytest``
.. versionadded:: 2.0
If you use Python-2.5 or later you can invoke testing through the
Python interpreter from the command line::
You can invoke testing through the Python interpreter from the command line::
python -m pytest [...]

View File

@ -61,16 +61,16 @@ a lot of I/O this can lead to considerable speed ups.
Running tests in a Python subprocess
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To instantiate a Python-2.4 subprocess and send tests to it, you may type::
To instantiate a Python-2.7 subprocess and send tests to it, you may type::
py.test -d --tx popen//python=python2.4
py.test -d --tx popen//python=python2.7
This will start a subprocess which is run with the "python2.4"
This will start a subprocess which is run with the "python2.7"
Python interpreter, found in your system binary lookup path.
If you prefix the --tx option value like this::
py.test -d --tx 3*popen//python=python2.4
py.test -d --tx 3*popen//python=python2.7
then three subprocesses would be created and the tests
will be distributed to three subprocesses and run simultanously.
@ -170,7 +170,7 @@ For example, you could make running with three subprocesses your default::
You can also add default environments like this::
[pytest]
addopts = --tx ssh=myhost//python=python2.5 --tx ssh=myhost//python=python2.6
addopts = --tx ssh=myhost//python=python2.7 --tx ssh=myhost//python=python2.6
and then just type::