From ec597e81a4621b381edefbd2ca2f57895b06677a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 16 Dec 2015 16:14:36 -0200 Subject: [PATCH] Remove references to python pre-2.6 from docs --- doc/en/assert.rst | 7 +++---- doc/en/example/markers.rst | 4 ++-- doc/en/faq.rst | 5 ++--- doc/en/skipping.rst | 17 +---------------- doc/en/test/plugin/xdist.rst | 4 ++-- doc/en/usage.rst | 3 +-- doc/en/xdist.rst | 10 +++++----- 7 files changed, 16 insertions(+), 34 deletions(-) diff --git a/doc/en/assert.rst b/doc/en/assert.rst index 795f52586..f65225c92 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -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. diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index aaca80fb2..cf8cbb00d 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -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 diff --git a/doc/en/faq.rst b/doc/en/faq.rst index dbcaf3fd4..3c019b5e1 100644 --- a/doc/en/faq.rst +++ b/doc/en/faq.rst @@ -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 diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst index 7464758f5..30f059407 100644 --- a/doc/en/skipping.rst +++ b/doc/en/skipping.rst @@ -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 ` 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: diff --git a/doc/en/test/plugin/xdist.rst b/doc/en/test/plugin/xdist.rst index f2c877be7..7ab6cdc8b 100644 --- a/doc/en/test/plugin/xdist.rst +++ b/doc/en/test/plugin/xdist.rst @@ -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`` diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 2deaadb5d..b8abb87e9 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -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 [...] diff --git a/doc/en/xdist.rst b/doc/en/xdist.rst index 715aa4749..ee1bd6032 100644 --- a/doc/en/xdist.rst +++ b/doc/en/xdist.rst @@ -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::