regenerate docs from the pytest env
This commit is contained in:
parent
c765fa6d04
commit
d1e44d16e7
|
@ -21,6 +21,7 @@ REGENDOC_ARGS := \
|
|||
--normalize "@(This is pytest version )(\d+)\\.[^ ,]+@\1\2.x.y@" \
|
||||
--normalize "@py-(\d+)\\.[^ ,]+@py-\1.x.y@" \
|
||||
--normalize "@pluggy-(\d+)\\.[.\d,]+@pluggy-\1.x.y@" \
|
||||
--normalize "@hypothesis-(\d+)\\.[.\d,]+@hypothesis-\1.x.y@" \
|
||||
--normalize "@Python (\d+)\\.[^ ,]+@Python \1.x.y@"
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
|
||||
|
|
|
@ -28,6 +28,7 @@ you will see the return value of the function call::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_assert1.py F
|
||||
|
@ -172,6 +173,7 @@ if you run this module::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_assert2.py F
|
||||
|
|
|
@ -83,6 +83,7 @@ If you then run it with ``--lf``::
|
|||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
run-last-failure: rerun last 2 failures
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 50 items
|
||||
|
||||
test_50.py FF
|
||||
|
@ -125,6 +126,7 @@ of ``FF`` and dots)::
|
|||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
run-last-failure: rerun last 2 failures first
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 50 items
|
||||
|
||||
test_50.py FF................................................
|
||||
|
@ -229,6 +231,7 @@ You can always peek at the content of the cache using the
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
cachedir: $REGENDOC_TMPDIR/.cache
|
||||
------------------------------- cache values -------------------------------
|
||||
cache/lastfailed contains:
|
||||
|
|
|
@ -66,6 +66,7 @@ of the failing function and hide the other one::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_module.py .F
|
||||
|
|
|
@ -64,6 +64,7 @@ then you can just invoke ``pytest`` without command line options::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
mymodule.py .
|
||||
|
|
|
@ -31,9 +31,10 @@ You can then restrict a test run to only run tests marked with ``webtest``::
|
|||
|
||||
$ pytest -v -m webtest
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 4 items
|
||||
|
||||
test_server.py::test_send_http PASSED
|
||||
|
@ -45,9 +46,10 @@ Or the inverse, running all tests except the webtest ones::
|
|||
|
||||
$ pytest -v -m "not webtest"
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 4 items
|
||||
|
||||
test_server.py::test_something_quick PASSED
|
||||
|
@ -66,9 +68,10 @@ tests based on their module, class, method, or function name::
|
|||
|
||||
$ pytest -v test_server.py::TestClass::test_method
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 5 items
|
||||
|
||||
test_server.py::TestClass::test_method PASSED
|
||||
|
@ -79,9 +82,10 @@ You can also select on the class::
|
|||
|
||||
$ pytest -v test_server.py::TestClass
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 4 items
|
||||
|
||||
test_server.py::TestClass::test_method PASSED
|
||||
|
@ -92,9 +96,10 @@ Or select multiple nodes::
|
|||
|
||||
$ pytest -v test_server.py::TestClass test_server.py::test_send_http
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 8 items
|
||||
|
||||
test_server.py::TestClass::test_method PASSED
|
||||
|
@ -130,9 +135,10 @@ select tests based on their names::
|
|||
|
||||
$ pytest -v -k http # running with the above defined example module
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 4 items
|
||||
|
||||
test_server.py::test_send_http PASSED
|
||||
|
@ -144,9 +150,10 @@ And you can also run all tests except the ones that match the keyword::
|
|||
|
||||
$ pytest -k "not send_http" -v
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 4 items
|
||||
|
||||
test_server.py::test_something_quick PASSED
|
||||
|
@ -160,9 +167,10 @@ Or to select "http" and "quick" tests::
|
|||
|
||||
$ pytest -k "http or quick" -v
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 4 items
|
||||
|
||||
test_server.py::test_send_http PASSED
|
||||
|
@ -201,6 +209,8 @@ You can ask which markers exist for your test suite - the list includes our just
|
|||
$ pytest --markers
|
||||
@pytest.mark.webtest: mark a test as a webtest.
|
||||
|
||||
@pytest.mark.hypothesis: Tests which use hypothesis.
|
||||
|
||||
@pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.
|
||||
|
||||
@pytest.mark.skipif(condition): skip the given test function if eval(condition) results in a True value. Evaluation happens within the module global context. Example: skipif('sys.platform == "win32"') skips the test if we are on the win32 platform. see http://pytest.org/latest/skipping.html
|
||||
|
@ -354,6 +364,7 @@ the test needs::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_someenv.py s
|
||||
|
@ -366,6 +377,7 @@ and here is one that specifies exactly the environment needed::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_someenv.py .
|
||||
|
@ -377,6 +389,8 @@ The ``--markers`` option always gives you a list of available markers::
|
|||
$ pytest --markers
|
||||
@pytest.mark.env(name): mark test to run only on named environment
|
||||
|
||||
@pytest.mark.hypothesis: Tests which use hypothesis.
|
||||
|
||||
@pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.
|
||||
|
||||
@pytest.mark.skipif(condition): skip the given test function if eval(condition) results in a True value. Evaluation happens within the module global context. Example: skipif('sys.platform == "win32"') skips the test if we are on the win32 platform. see http://pytest.org/latest/skipping.html
|
||||
|
@ -487,6 +501,7 @@ then you will see two tests skipped and two executed tests as expected::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
|
||||
test_plat.py s.s.
|
||||
|
@ -501,6 +516,7 @@ Note that if you specify a platform via the marker-command line option like this
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
|
||||
test_plat.py .
|
||||
|
@ -553,6 +569,7 @@ We can now use the ``-m option`` to select one set::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
|
||||
test_module.py FF
|
||||
|
@ -575,6 +592,7 @@ or to select both "event" and "interface" tests::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
|
||||
test_module.py FFF
|
||||
|
|
|
@ -29,16 +29,16 @@ now execute the test specification::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
||||
collected 2 items
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 0 items / 1 errors
|
||||
|
||||
test_simple.yml F.
|
||||
|
||||
======= FAILURES ========
|
||||
_______ usecase: hello ________
|
||||
usecase execution failed
|
||||
spec failed: 'some': 'other'
|
||||
no further details known at this point.
|
||||
======= 1 failed, 1 passed in 0.12 seconds ========
|
||||
======= ERRORS ========
|
||||
_______ ERROR collecting test_simple.yml ________
|
||||
conftest.py:11: in collect
|
||||
import yaml # we need a yaml parser, e.g. PyYAML
|
||||
E ImportError: No module named 'yaml'
|
||||
!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!
|
||||
======= 1 error in 0.12 seconds ========
|
||||
|
||||
.. regendoc:wipe
|
||||
|
||||
|
@ -59,20 +59,19 @@ consulted when reporting in ``verbose`` mode::
|
|||
|
||||
nonpython $ pytest -v
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
||||
collecting ... collected 2 items
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 0 items / 1 errors
|
||||
|
||||
test_simple.yml::hello FAILED
|
||||
test_simple.yml::ok PASSED
|
||||
|
||||
======= FAILURES ========
|
||||
_______ usecase: hello ________
|
||||
usecase execution failed
|
||||
spec failed: 'some': 'other'
|
||||
no further details known at this point.
|
||||
======= 1 failed, 1 passed in 0.12 seconds ========
|
||||
======= ERRORS ========
|
||||
_______ ERROR collecting test_simple.yml ________
|
||||
conftest.py:11: in collect
|
||||
import yaml # we need a yaml parser, e.g. PyYAML
|
||||
E ImportError: No module named 'yaml'
|
||||
!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!
|
||||
======= 1 error in 0.12 seconds ========
|
||||
|
||||
.. regendoc:wipe
|
||||
|
||||
|
@ -83,9 +82,13 @@ interesting to just look at the collection tree::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
||||
collected 2 items
|
||||
<YamlFile 'test_simple.yml'>
|
||||
<YamlItem 'hello'>
|
||||
<YamlItem 'ok'>
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 0 items / 1 errors
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
======= ERRORS ========
|
||||
_______ ERROR collecting test_simple.yml ________
|
||||
conftest.py:11: in collect
|
||||
import yaml # we need a yaml parser, e.g. PyYAML
|
||||
E ImportError: No module named 'yaml'
|
||||
!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!
|
||||
======= 1 error in 0.12 seconds ========
|
||||
|
|
|
@ -132,6 +132,7 @@ objects, they are still using the default pytest representation::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 6 items
|
||||
<Module 'test_time.py'>
|
||||
<Function 'test_timedistance_v0[a0-b0-expected0]'>
|
||||
|
@ -183,6 +184,7 @@ this is a fully self-contained example which you can run with::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
|
||||
test_scenarios.py ....
|
||||
|
@ -196,6 +198,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
<Module 'test_scenarios.py'>
|
||||
<Class 'TestSampleWithScenarios'>
|
||||
|
@ -261,6 +264,7 @@ Let's first see how it looks like at collection time::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
<Module 'test_backends.py'>
|
||||
<Function 'test_db_initialized[d1]'>
|
||||
|
@ -322,6 +326,7 @@ The result of this test will be successful::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
<Module 'test_indirect_list.py'>
|
||||
<Function 'test_indirect[a-b]'>
|
||||
|
@ -397,32 +402,8 @@ is to be run with different sets of arguments for its three arguments:
|
|||
Running it results in some skips if we don't have all the python interpreters installed and otherwise runs all combinations (5 interpreters times 5 interpreters times 3 objects to serialize/deserialize)::
|
||||
|
||||
. $ pytest -rs -q multipython.py
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 326, in _getconftestmodules
|
||||
return self._path2confmods[path]
|
||||
KeyError: local('$REGENDOC_TMPDIR/CWD/multipython.py')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 326, in _getconftestmodules
|
||||
return self._path2confmods[path]
|
||||
KeyError: local('$REGENDOC_TMPDIR/CWD')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 357, in _importconftest
|
||||
return self._conftestpath2mod[conftestpath]
|
||||
KeyError: local('$REGENDOC_TMPDIR/CWD/conftest.py')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 363, in _importconftest
|
||||
mod = conftestpath.pyimport()
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/py/_path/local.py", line 680, in pyimport
|
||||
raise self.ImportMismatchError(modname, modfile, self)
|
||||
py._path.local.LocalPath.ImportMismatchError: ('conftest', '$PWD/example/conftest.py', local('$REGENDOC_TMPDIR/CWD/conftest.py'))
|
||||
ERROR: could not load $REGENDOC_TMPDIR/CWD/conftest.py
|
||||
|
||||
................................................
|
||||
48 passed in 0.12 seconds
|
||||
|
||||
Indirect parametrization of optional implementations/imports
|
||||
--------------------------------------------------------------------
|
||||
|
@ -471,6 +452,7 @@ If you run this with reporting for skips enabled::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_module.py .s
|
||||
|
|
|
@ -119,6 +119,7 @@ then the test collection looks like this::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
<Module 'check_myapp.py'>
|
||||
<Class 'CheckMyApp'>
|
||||
|
@ -162,32 +163,19 @@ Finding out what is collected
|
|||
You can always peek at the collection tree without running tests like this::
|
||||
|
||||
. $ pytest --collect-only pythoncollection.py
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 326, in _getconftestmodules
|
||||
return self._path2confmods[path]
|
||||
KeyError: local('$REGENDOC_TMPDIR/CWD/pythoncollection.py')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 326, in _getconftestmodules
|
||||
return self._path2confmods[path]
|
||||
KeyError: local('$REGENDOC_TMPDIR/CWD')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 357, in _importconftest
|
||||
return self._conftestpath2mod[conftestpath]
|
||||
KeyError: local('$REGENDOC_TMPDIR/CWD/conftest.py')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 363, in _importconftest
|
||||
mod = conftestpath.pyimport()
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/py/_path/local.py", line 680, in pyimport
|
||||
raise self.ImportMismatchError(modname, modfile, self)
|
||||
py._path.local.LocalPath.ImportMismatchError: ('conftest', '$PWD/example/conftest.py', local('$REGENDOC_TMPDIR/CWD/conftest.py'))
|
||||
ERROR: could not load $REGENDOC_TMPDIR/CWD/conftest.py
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 3 items
|
||||
<Module 'CWD/pythoncollection.py'>
|
||||
<Function 'test_function'>
|
||||
<Class 'TestClass'>
|
||||
<Instance '()'>
|
||||
<Function 'test_method'>
|
||||
<Function 'test_anothermethod'>
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
|
||||
customizing test collection to find all .py files
|
||||
---------------------------------------------------------
|
||||
|
@ -246,6 +234,7 @@ will be left out::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 0 items
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
|
|
|
@ -13,6 +13,7 @@ get on the terminal - we are working on that)::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR/assertion, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 42 items
|
||||
|
||||
failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
|
@ -358,7 +359,7 @@ get on the terminal - we are working on that)::
|
|||
> int(s)
|
||||
E ValueError: invalid literal for int() with base 10: 'qwe'
|
||||
|
||||
<0-codegen $PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/python.py:1219>:1: ValueError
|
||||
<0-codegen /home/rpfannsc/Projects/pytest-dev/pytest/_pytest/python.py:1219>:1: ValueError
|
||||
_______ TestRaises.test_raises_doesnt ________
|
||||
|
||||
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||
|
|
|
@ -115,6 +115,7 @@ directory with the above conftest.py::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 0 items
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
|
@ -166,6 +167,7 @@ and when running it will see a skipped "slow" test::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_module.py .s
|
||||
|
@ -180,6 +182,7 @@ Or run it including the ``slow`` marked test::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_module.py ..
|
||||
|
@ -305,6 +308,7 @@ which will add the string to the test header accordingly::
|
|||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
project deps: mylib-1.1
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 0 items
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
|
@ -327,11 +331,12 @@ which will add info only when run with "--v"::
|
|||
|
||||
$ pytest -v
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
info1: did you know that ...
|
||||
did you?
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 0 items
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
|
@ -342,6 +347,7 @@ and nothing when run plainly::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 0 items
|
||||
|
||||
======= no tests ran in 0.12 seconds ========
|
||||
|
@ -376,6 +382,7 @@ Now we can profile which test functions execute the slowest::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 3 items
|
||||
|
||||
test_some_are_slow.py ...
|
||||
|
@ -383,7 +390,7 @@ Now we can profile which test functions execute the slowest::
|
|||
======= slowest 3 test durations ========
|
||||
0.20s call test_some_are_slow.py::test_funcslow2
|
||||
0.10s call test_some_are_slow.py::test_funcslow1
|
||||
0.00s setup test_some_are_slow.py::test_funcslow2
|
||||
0.00s teardown test_some_are_slow.py::test_funcslow2
|
||||
======= 3 passed in 0.12 seconds ========
|
||||
|
||||
incremental testing - test steps
|
||||
|
@ -442,6 +449,7 @@ If we run this::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 4 items
|
||||
|
||||
test_step.py .Fx.
|
||||
|
@ -521,6 +529,7 @@ We can run this::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 7 items
|
||||
|
||||
test_step.py .Fx.
|
||||
|
@ -629,6 +638,7 @@ and run them::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_module.py FF
|
||||
|
@ -723,6 +733,7 @@ and run it::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 3 items
|
||||
|
||||
test_module.py Esetting up a test failed! test_module.py::test_setup_fails
|
||||
|
|
|
@ -72,6 +72,7 @@ marked ``smtp`` fixture function. Running the test looks like this::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_smtpsimple.py F
|
||||
|
@ -190,6 +191,7 @@ inspect what is going on and can now run the tests::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_module.py FF
|
||||
|
@ -525,6 +527,7 @@ Running the above tests results in the following test IDs being used::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 10 items
|
||||
<Module 'test_anothersmtp.py'>
|
||||
<Function 'test_showhelo[smtp.gmail.com]'>
|
||||
|
@ -574,9 +577,10 @@ Here we declare an ``app`` fixture which receives the previously defined
|
|||
|
||||
$ pytest -v test_appsetup.py
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 2 items
|
||||
|
||||
test_appsetup.py::test_smtp_exists[smtp.gmail.com] PASSED
|
||||
|
@ -643,9 +647,10 @@ Let's run the tests in verbose mode and with looking at the print-output::
|
|||
|
||||
$ pytest -v -s test_module.py
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3
|
||||
cachedir: .cache
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collecting ... collected 8 items
|
||||
|
||||
test_module.py::test_0[1] SETUP otherarg 1
|
||||
|
|
|
@ -26,7 +26,9 @@ Installation::
|
|||
To check your installation has installed the correct version::
|
||||
|
||||
$ pytest --version
|
||||
This is pytest version 3.x.y, imported from $PYTHON_PREFIX/lib/python3.5/site-packages/pytest.py
|
||||
This is pytest version 3.x.y, imported from /home/rpfannsc/Projects/pytest-dev/pytest/pytest.py
|
||||
setuptools registered plugins:
|
||||
hypothesis-3.x.y at $PYTHON_PREFIX/lib/python3.5/site-packages/hypothesis/extra/pytestplugin.py
|
||||
|
||||
.. _`simpletest`:
|
||||
|
||||
|
@ -48,6 +50,7 @@ That's it. You can execute the test function now::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_sample.py F
|
||||
|
|
|
@ -27,6 +27,7 @@ To execute it::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_sample.py F
|
||||
|
|
|
@ -57,6 +57,7 @@ them in turn::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 3 items
|
||||
|
||||
test_expectation.py ..F
|
||||
|
@ -126,6 +127,7 @@ Let's run this::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 3 items
|
||||
|
||||
test_expectation.py ..x
|
||||
|
|
|
@ -223,32 +223,28 @@ Here is a simple test file with the several usages:
|
|||
Running it with the report-on-xfail option gives this output::
|
||||
|
||||
example $ pytest -rx xfail_demo.py
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 326, in _getconftestmodules
|
||||
return self._path2confmods[path]
|
||||
KeyError: local('$REGENDOC_TMPDIR/example/xfail_demo.py')
|
||||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR/example, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 7 items
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 326, in _getconftestmodules
|
||||
return self._path2confmods[path]
|
||||
KeyError: local('$REGENDOC_TMPDIR/example')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 357, in _importconftest
|
||||
return self._conftestpath2mod[conftestpath]
|
||||
KeyError: local('$REGENDOC_TMPDIR/example/conftest.py')
|
||||
|
||||
During handling of the above exception, another exception occurred:
|
||||
Traceback (most recent call last):
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/config.py", line 363, in _importconftest
|
||||
mod = conftestpath.pyimport()
|
||||
File "$PYTHON_PREFIX/lib/python3.5/site-packages/py/_path/local.py", line 680, in pyimport
|
||||
raise self.ImportMismatchError(modname, modfile, self)
|
||||
py._path.local.LocalPath.ImportMismatchError: ('conftest', '$PWD/example/conftest.py', local('$REGENDOC_TMPDIR/example/conftest.py'))
|
||||
ERROR: could not load $REGENDOC_TMPDIR/example/conftest.py
|
||||
xfail_demo.py xxxxxxx
|
||||
======= short test summary info ========
|
||||
XFAIL xfail_demo.py::test_hello
|
||||
XFAIL xfail_demo.py::test_hello2
|
||||
reason: [NOTRUN]
|
||||
XFAIL xfail_demo.py::test_hello3
|
||||
condition: hasattr(os, 'sep')
|
||||
XFAIL xfail_demo.py::test_hello4
|
||||
bug 110
|
||||
XFAIL xfail_demo.py::test_hello5
|
||||
condition: pytest.__version__[0] != "17"
|
||||
XFAIL xfail_demo.py::test_hello6
|
||||
reason: reason
|
||||
XFAIL xfail_demo.py::test_hello7
|
||||
|
||||
======= 7 xfailed in 0.12 seconds ========
|
||||
|
||||
xfail signature summary
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -31,6 +31,7 @@ Running this would result in a passed test except for the last
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_tmpdir.py F
|
||||
|
|
|
@ -110,6 +110,7 @@ the ``self.db`` values in the traceback::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 2 items
|
||||
|
||||
test_unittest_db.py FF
|
||||
|
|
|
@ -24,6 +24,7 @@ Running pytest now produces this output::
|
|||
======= test session starts ========
|
||||
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
|
||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||
plugins: hypothesis-3.x.y
|
||||
collected 1 items
|
||||
|
||||
test_show_warnings.py .
|
||||
|
|
Loading…
Reference in New Issue