generate docs on python3.4
This commit is contained in:
parent
5ff75a41ea
commit
c3588b545f
|
@ -26,7 +26,7 @@ you will see the return value of the function call::
|
||||||
|
|
||||||
$ py.test test_assert1.py
|
$ py.test test_assert1.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ if you run this module::
|
||||||
|
|
||||||
$ py.test test_assert2.py
|
$ py.test test_assert2.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ You can ask for available builtin or project-custom
|
||||||
|
|
||||||
$ py.test -q --fixtures
|
$ py.test -q --fixtures
|
||||||
cache
|
cache
|
||||||
$PYTHON_PREFIX/lib/python2.7/site-packages/_pytest/cacheprovider.py:176: no docstring available
|
$PYTHON_PREFIX/lib/python3.4/site-packages/_pytest/cacheprovider.py:176: no docstring available
|
||||||
capsys
|
capsys
|
||||||
enables capturing of writes to sys.stdout/sys.stderr and makes
|
enables capturing of writes to sys.stdout/sys.stderr and makes
|
||||||
captured output available via ``capsys.readouterr()`` method calls
|
captured output available via ``capsys.readouterr()`` method calls
|
||||||
|
|
|
@ -73,7 +73,7 @@ If you then run it with ``--lf``::
|
||||||
|
|
||||||
$ py.test --lf
|
$ py.test --lf
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
run-last-failure: rerun last 2 failures
|
run-last-failure: rerun last 2 failures
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 50 items
|
collected 50 items
|
||||||
|
@ -114,7 +114,7 @@ of ``FF`` and dots)::
|
||||||
|
|
||||||
$ py.test --ff
|
$ py.test --ff
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
run-last-failure: rerun last 2 failures first
|
run-last-failure: rerun last 2 failures first
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 50 items
|
collected 50 items
|
||||||
|
@ -219,7 +219,7 @@ You can always peek at the content of the cache using the
|
||||||
|
|
||||||
$ py.test --cache-clear
|
$ py.test --cache-clear
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ of the failing function and hide the other one::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ then you can just invoke ``py.test`` without command line options::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ You can then restrict a test run to only run tests marked with ``webtest``::
|
||||||
|
|
||||||
$ py.test -v -m webtest
|
$ py.test -v -m webtest
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 4 items
|
collecting ... collected 4 items
|
||||||
|
@ -45,7 +45,7 @@ Or the inverse, running all tests except the webtest ones::
|
||||||
|
|
||||||
$ py.test -v -m "not webtest"
|
$ py.test -v -m "not webtest"
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 4 items
|
collecting ... collected 4 items
|
||||||
|
@ -66,7 +66,7 @@ tests based on their module, class, method, or function name::
|
||||||
|
|
||||||
$ py.test -v test_server.py::TestClass::test_method
|
$ py.test -v test_server.py::TestClass::test_method
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 5 items
|
collecting ... collected 5 items
|
||||||
|
@ -79,7 +79,7 @@ You can also select on the class::
|
||||||
|
|
||||||
$ py.test -v test_server.py::TestClass
|
$ py.test -v test_server.py::TestClass
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 4 items
|
collecting ... collected 4 items
|
||||||
|
@ -92,7 +92,7 @@ Or select multiple nodes::
|
||||||
|
|
||||||
$ py.test -v test_server.py::TestClass test_server.py::test_send_http
|
$ py.test -v test_server.py::TestClass test_server.py::test_send_http
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 8 items
|
collecting ... collected 8 items
|
||||||
|
@ -130,7 +130,7 @@ select tests based on their names::
|
||||||
|
|
||||||
$ py.test -v -k http # running with the above defined example module
|
$ py.test -v -k http # running with the above defined example module
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 4 items
|
collecting ... collected 4 items
|
||||||
|
@ -144,7 +144,7 @@ And you can also run all tests except the ones that match the keyword::
|
||||||
|
|
||||||
$ py.test -k "not send_http" -v
|
$ py.test -k "not send_http" -v
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 4 items
|
collecting ... collected 4 items
|
||||||
|
@ -160,7 +160,7 @@ Or to select "http" and "quick" tests::
|
||||||
|
|
||||||
$ py.test -k "http or quick" -v
|
$ py.test -k "http or quick" -v
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 4 items
|
collecting ... collected 4 items
|
||||||
|
@ -350,7 +350,7 @@ the test needs::
|
||||||
|
|
||||||
$ py.test -E stage2
|
$ py.test -E stage2
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ and here is one that specifies exactly the environment needed::
|
||||||
|
|
||||||
$ py.test -E stage1
|
$ py.test -E stage1
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
@ -481,28 +481,28 @@ then you will see two test skipped and two executed tests as expected::
|
||||||
|
|
||||||
$ py.test -rs # this option reports skip reasons
|
$ py.test -rs # this option reports skip reasons
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
|
|
||||||
test_plat.py s.s.
|
test_plat.py sss.
|
||||||
======= short test summary info ========
|
======= short test summary info ========
|
||||||
SKIP [2] $REGENDOC_TMPDIR/conftest.py:12: cannot run on platform linux2
|
SKIP [3] $REGENDOC_TMPDIR/conftest.py:12: cannot run on platform linux
|
||||||
|
|
||||||
======= 2 passed, 2 skipped in 0.12 seconds ========
|
======= 1 passed, 3 skipped in 0.12 seconds ========
|
||||||
|
|
||||||
Note that if you specify a platform via the marker-command line option like this::
|
Note that if you specify a platform via the marker-command line option like this::
|
||||||
|
|
||||||
$ py.test -m linux2
|
$ py.test -m linux2
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
|
|
||||||
test_plat.py .
|
test_plat.py s
|
||||||
|
|
||||||
======= 3 tests deselected by "-m 'linux2'" ========
|
======= 3 tests deselected by "-m 'linux2'" ========
|
||||||
======= 1 passed, 3 deselected in 0.12 seconds ========
|
======= 1 skipped, 3 deselected in 0.12 seconds ========
|
||||||
|
|
||||||
then the unmarked-tests will not be run. It is thus a way to restrict the run to the specific tests.
|
then the unmarked-tests will not be run. It is thus a way to restrict the run to the specific tests.
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ We can now use the ``-m option`` to select one set::
|
||||||
|
|
||||||
$ py.test -m interface --tb=short
|
$ py.test -m interface --tb=short
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ or to select both "event" and "interface" tests::
|
||||||
|
|
||||||
$ py.test -m "interface or event" --tb=short
|
$ py.test -m "interface or event" --tb=short
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,11 @@ now execute the test specification::
|
||||||
|
|
||||||
nonpython $ py.test test_simple.yml
|
nonpython $ py.test test_simple.yml
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
test_simple.yml F.
|
test_simple.yml .F
|
||||||
|
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ usecase: hello ________
|
_______ usecase: hello ________
|
||||||
|
@ -59,13 +59,13 @@ consulted when reporting in ``verbose`` mode::
|
||||||
|
|
||||||
nonpython $ py.test -v
|
nonpython $ py.test -v
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
||||||
collecting ... collected 2 items
|
collecting ... collected 2 items
|
||||||
|
|
||||||
test_simple.yml::hello FAILED
|
|
||||||
test_simple.yml::ok PASSED
|
test_simple.yml::ok PASSED
|
||||||
|
test_simple.yml::hello FAILED
|
||||||
|
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ usecase: hello ________
|
_______ usecase: hello ________
|
||||||
|
@ -81,11 +81,11 @@ interesting to just look at the collection tree::
|
||||||
|
|
||||||
nonpython $ py.test --collect-only
|
nonpython $ py.test --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
<YamlFile 'test_simple.yml'>
|
<YamlFile 'test_simple.yml'>
|
||||||
<YamlItem 'hello'>
|
|
||||||
<YamlItem 'ok'>
|
<YamlItem 'ok'>
|
||||||
|
<YamlItem 'hello'>
|
||||||
|
|
||||||
======= in 0.12 seconds ========
|
======= in 0.12 seconds ========
|
||||||
|
|
|
@ -127,20 +127,20 @@ objects, they are still using the default pytest representation::
|
||||||
|
|
||||||
$ py.test test_time.py --collect-only
|
$ py.test test_time.py --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 0 items / 1 errors
|
collected 0 items / 1 errors
|
||||||
|
|
||||||
======= ERRORS ========
|
======= ERRORS ========
|
||||||
_______ ERROR collecting test_time.py ________
|
_______ ERROR collecting test_time.py ________
|
||||||
$PYTHON_PREFIX/lib/python2.7/site-packages/_pytest/python.py:581: in _importtestmodule
|
$PYTHON_PREFIX/lib/python3.4/site-packages/_pytest/python.py:581: in _importtestmodule
|
||||||
mod = self.fspath.pyimport(ensuresyspath=importmode)
|
mod = self.fspath.pyimport(ensuresyspath=importmode)
|
||||||
$PYTHON_PREFIX/lib/python2.7/site-packages/py/_path/local.py:650: in pyimport
|
$PYTHON_PREFIX/lib/python3.4/site-packages/py/_path/local.py:650: in pyimport
|
||||||
__import__(modname)
|
__import__(modname)
|
||||||
E File "$REGENDOC_TMPDIR/test_time.py", line 6
|
E File "$REGENDOC_TMPDIR/test_time.py", line 5
|
||||||
E
|
E (datetime(2001, 12, 11), datetime(2001, 12, 12), timedelta(-1)),
|
||||||
E ^
|
E ^
|
||||||
E SyntaxError: invalid syntax
|
E SyntaxError: unexpected EOF while parsing
|
||||||
======= 1 error in 0.12 seconds ========
|
======= 1 error in 0.12 seconds ========
|
||||||
|
|
||||||
A quick port of "testscenarios"
|
A quick port of "testscenarios"
|
||||||
|
@ -181,7 +181,7 @@ this is a fully self-contained example which you can run with::
|
||||||
|
|
||||||
$ py.test test_scenarios.py
|
$ py.test test_scenarios.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia
|
||||||
|
|
||||||
$ py.test --collect-only test_scenarios.py
|
$ py.test --collect-only test_scenarios.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
<Module 'test_scenarios.py'>
|
<Module 'test_scenarios.py'>
|
||||||
|
@ -259,7 +259,7 @@ Let's first see how it looks like at collection time::
|
||||||
|
|
||||||
$ py.test test_backends.py --collect-only
|
$ py.test test_backends.py --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
<Module 'test_backends.py'>
|
<Module 'test_backends.py'>
|
||||||
|
@ -275,7 +275,7 @@ And then when we run the test::
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ test_db_initialized[d2] ________
|
_______ test_db_initialized[d2] ________
|
||||||
|
|
||||||
db = <conftest.DB2 instance at 0xdeadbeef>
|
db = <conftest.DB2 object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_db_initialized(db):
|
def test_db_initialized(db):
|
||||||
# a dummy test
|
# a dummy test
|
||||||
|
@ -320,7 +320,7 @@ The result of this test will be successful:
|
||||||
|
|
||||||
$ py.test test_indirect_list.py --collect-only
|
$ py.test test_indirect_list.py --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
<Module 'test_indirect_list.py'>
|
<Module 'test_indirect_list.py'>
|
||||||
|
@ -369,9 +369,9 @@ argument sets to use for each test function. Let's run it::
|
||||||
$ py.test -q
|
$ py.test -q
|
||||||
F..
|
F..
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ TestClass.test_equals[2-1] ________
|
_______ TestClass.test_equals[1-2] ________
|
||||||
|
|
||||||
self = <test_parametrize.TestClass instance at 0xdeadbeef>, a = 1, b = 2
|
self = <test_parametrize.TestClass object at 0xdeadbeef>, a = 1, b = 2
|
||||||
|
|
||||||
def test_equals(self, a, b):
|
def test_equals(self, a, b):
|
||||||
> assert a == b
|
> assert a == b
|
||||||
|
@ -399,8 +399,8 @@ Running it results in some skips if we don't have all the python interpreters in
|
||||||
. $ py.test -rs -q multipython.py
|
. $ py.test -rs -q multipython.py
|
||||||
ssssssssssss...ssssssssssss
|
ssssssssssss...ssssssssssss
|
||||||
======= short test summary info ========
|
======= short test summary info ========
|
||||||
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:22: 'python2.6' not found
|
|
||||||
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:22: 'python3.3' not found
|
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:22: 'python3.3' not found
|
||||||
|
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:22: 'python2.6' not found
|
||||||
3 passed, 24 skipped in 0.12 seconds
|
3 passed, 24 skipped in 0.12 seconds
|
||||||
|
|
||||||
Indirect parametrization of optional implementations/imports
|
Indirect parametrization of optional implementations/imports
|
||||||
|
@ -448,7 +448,7 @@ If you run this with reporting for skips enabled::
|
||||||
|
|
||||||
$ py.test -rs test_module.py
|
$ py.test -rs test_module.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ then the test collection looks like this::
|
||||||
|
|
||||||
$ py.test --collect-only
|
$ py.test --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile: setup.cfg
|
rootdir: $REGENDOC_TMPDIR, inifile: setup.cfg
|
||||||
collected 2 items
|
collected 2 items
|
||||||
<Module 'check_myapp.py'>
|
<Module 'check_myapp.py'>
|
||||||
|
@ -89,7 +89,7 @@ You can always peek at the collection tree without running tests like this::
|
||||||
|
|
||||||
. $ py.test --collect-only pythoncollection.py
|
. $ py.test --collect-only pythoncollection.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||||
collected 3 items
|
collected 3 items
|
||||||
<Module 'CWD/pythoncollection.py'>
|
<Module 'CWD/pythoncollection.py'>
|
||||||
|
@ -143,11 +143,9 @@ interpreters and will leave out the setup.py file::
|
||||||
|
|
||||||
$ py.test --collect-only
|
$ py.test --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
|
||||||
collected 1 items
|
collected 0 items
|
||||||
<Module 'pkg/module_py2.py'>
|
|
||||||
<Function 'test_only_on_python2'>
|
|
||||||
|
|
||||||
======= in 0.12 seconds ========
|
======= in 0.12 seconds ========
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ get on the terminal - we are working on that):
|
||||||
|
|
||||||
assertion $ py.test failure_demo.py
|
assertion $ py.test failure_demo.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR/assertion, inifile:
|
rootdir: $REGENDOC_TMPDIR/assertion, inifile:
|
||||||
collected 42 items
|
collected 42 items
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ get on the terminal - we are working on that):
|
||||||
|
|
||||||
> assert f() == g()
|
> assert f() == g()
|
||||||
E assert 42 == 43
|
E assert 42 == 43
|
||||||
E + where 42 = <function f at 0xdeadbeef>()
|
E + where 42 = <function TestFailing.test_simple.<locals>.f at 0xdeadbeef>()
|
||||||
E + and 43 = <function g at 0xdeadbeef>()
|
E + and 43 = <function TestFailing.test_simple.<locals>.g at 0xdeadbeef>()
|
||||||
|
|
||||||
failure_demo.py:28: AssertionError
|
failure_demo.py:28: AssertionError
|
||||||
_______ TestFailing.test_simple_multiline ________
|
_______ TestFailing.test_simple_multiline ________
|
||||||
|
@ -74,7 +74,7 @@ get on the terminal - we are working on that):
|
||||||
return 42
|
return 42
|
||||||
> assert not f()
|
> assert not f()
|
||||||
E assert not 42
|
E assert not 42
|
||||||
E + where 42 = <function f at 0xdeadbeef>()
|
E + where 42 = <function TestFailing.test_not.<locals>.f at 0xdeadbeef>()
|
||||||
|
|
||||||
failure_demo.py:38: AssertionError
|
failure_demo.py:38: AssertionError
|
||||||
_______ TestSpecialisedExplanations.test_eq_text ________
|
_______ TestSpecialisedExplanations.test_eq_text ________
|
||||||
|
@ -298,7 +298,7 @@ get on the terminal - we are working on that):
|
||||||
i = Foo()
|
i = Foo()
|
||||||
> assert i.b == 2
|
> assert i.b == 2
|
||||||
E assert 1 == 2
|
E assert 1 == 2
|
||||||
E + where 1 = <failure_demo.Foo object at 0xdeadbeef>.b
|
E + where 1 = <failure_demo.test_attribute.<locals>.Foo object at 0xdeadbeef>.b
|
||||||
|
|
||||||
failure_demo.py:101: AssertionError
|
failure_demo.py:101: AssertionError
|
||||||
_______ test_attribute_instance ________
|
_______ test_attribute_instance ________
|
||||||
|
@ -308,8 +308,8 @@ get on the terminal - we are working on that):
|
||||||
b = 1
|
b = 1
|
||||||
> assert Foo().b == 2
|
> assert Foo().b == 2
|
||||||
E assert 1 == 2
|
E assert 1 == 2
|
||||||
E + where 1 = <failure_demo.Foo object at 0xdeadbeef>.b
|
E + where 1 = <failure_demo.test_attribute_instance.<locals>.Foo object at 0xdeadbeef>.b
|
||||||
E + where <failure_demo.Foo object at 0xdeadbeef> = <class 'failure_demo.Foo'>()
|
E + where <failure_demo.test_attribute_instance.<locals>.Foo object at 0xdeadbeef> = <class 'failure_demo.test_attribute_instance.<locals>.Foo'>()
|
||||||
|
|
||||||
failure_demo.py:107: AssertionError
|
failure_demo.py:107: AssertionError
|
||||||
_______ test_attribute_failure ________
|
_______ test_attribute_failure ________
|
||||||
|
@ -325,7 +325,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:116:
|
failure_demo.py:116:
|
||||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
|
||||||
self = <failure_demo.Foo object at 0xdeadbeef>
|
self = <failure_demo.test_attribute_failure.<locals>.Foo object at 0xdeadbeef>
|
||||||
|
|
||||||
def _get_b(self):
|
def _get_b(self):
|
||||||
> raise Exception('Failed to get attrib')
|
> raise Exception('Failed to get attrib')
|
||||||
|
@ -341,15 +341,15 @@ get on the terminal - we are working on that):
|
||||||
b = 2
|
b = 2
|
||||||
> assert Foo().b == Bar().b
|
> assert Foo().b == Bar().b
|
||||||
E assert 1 == 2
|
E assert 1 == 2
|
||||||
E + where 1 = <failure_demo.Foo object at 0xdeadbeef>.b
|
E + where 1 = <failure_demo.test_attribute_multiple.<locals>.Foo object at 0xdeadbeef>.b
|
||||||
E + where <failure_demo.Foo object at 0xdeadbeef> = <class 'failure_demo.Foo'>()
|
E + where <failure_demo.test_attribute_multiple.<locals>.Foo object at 0xdeadbeef> = <class 'failure_demo.test_attribute_multiple.<locals>.Foo'>()
|
||||||
E + and 2 = <failure_demo.Bar object at 0xdeadbeef>.b
|
E + and 2 = <failure_demo.test_attribute_multiple.<locals>.Bar object at 0xdeadbeef>.b
|
||||||
E + where <failure_demo.Bar object at 0xdeadbeef> = <class 'failure_demo.Bar'>()
|
E + where <failure_demo.test_attribute_multiple.<locals>.Bar object at 0xdeadbeef> = <class 'failure_demo.test_attribute_multiple.<locals>.Bar'>()
|
||||||
|
|
||||||
failure_demo.py:124: AssertionError
|
failure_demo.py:124: AssertionError
|
||||||
_______ TestRaises.test_raises ________
|
_______ TestRaises.test_raises ________
|
||||||
|
|
||||||
self = <failure_demo.TestRaises instance at 0xdeadbeef>
|
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_raises(self):
|
def test_raises(self):
|
||||||
s = 'qwe'
|
s = 'qwe'
|
||||||
|
@ -361,10 +361,10 @@ get on the terminal - we are working on that):
|
||||||
> int(s)
|
> int(s)
|
||||||
E ValueError: invalid literal for int() with base 10: 'qwe'
|
E ValueError: invalid literal for int() with base 10: 'qwe'
|
||||||
|
|
||||||
<0-codegen $PYTHON_PREFIX/lib/python2.7/site-packages/_pytest/python.py:1205>:1: ValueError
|
<0-codegen $PYTHON_PREFIX/lib/python3.4/site-packages/_pytest/python.py:1205>:1: ValueError
|
||||||
_______ TestRaises.test_raises_doesnt ________
|
_______ TestRaises.test_raises_doesnt ________
|
||||||
|
|
||||||
self = <failure_demo.TestRaises instance at 0xdeadbeef>
|
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_raises_doesnt(self):
|
def test_raises_doesnt(self):
|
||||||
> raises(IOError, "int('3')")
|
> raises(IOError, "int('3')")
|
||||||
|
@ -373,7 +373,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:136: Failed
|
failure_demo.py:136: Failed
|
||||||
_______ TestRaises.test_raise ________
|
_______ TestRaises.test_raise ________
|
||||||
|
|
||||||
self = <failure_demo.TestRaises instance at 0xdeadbeef>
|
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_raise(self):
|
def test_raise(self):
|
||||||
> raise ValueError("demo error")
|
> raise ValueError("demo error")
|
||||||
|
@ -382,7 +382,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:139: ValueError
|
failure_demo.py:139: ValueError
|
||||||
_______ TestRaises.test_tupleerror ________
|
_______ TestRaises.test_tupleerror ________
|
||||||
|
|
||||||
self = <failure_demo.TestRaises instance at 0xdeadbeef>
|
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_tupleerror(self):
|
def test_tupleerror(self):
|
||||||
> a,b = [1]
|
> a,b = [1]
|
||||||
|
@ -391,7 +391,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:142: ValueError
|
failure_demo.py:142: ValueError
|
||||||
______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______
|
______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______
|
||||||
|
|
||||||
self = <failure_demo.TestRaises instance at 0xdeadbeef>
|
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
|
def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
|
||||||
l = [1,2,3]
|
l = [1,2,3]
|
||||||
|
@ -404,11 +404,11 @@ get on the terminal - we are working on that):
|
||||||
l is [1, 2, 3]
|
l is [1, 2, 3]
|
||||||
_______ TestRaises.test_some_error ________
|
_______ TestRaises.test_some_error ________
|
||||||
|
|
||||||
self = <failure_demo.TestRaises instance at 0xdeadbeef>
|
self = <failure_demo.TestRaises object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_some_error(self):
|
def test_some_error(self):
|
||||||
> if namenotexi:
|
> if namenotexi:
|
||||||
E NameError: global name 'namenotexi' is not defined
|
E NameError: name 'namenotexi' is not defined
|
||||||
|
|
||||||
failure_demo.py:150: NameError
|
failure_demo.py:150: NameError
|
||||||
_______ test_dynamic_compile_shows_nicely ________
|
_______ test_dynamic_compile_shows_nicely ________
|
||||||
|
@ -432,7 +432,7 @@ get on the terminal - we are working on that):
|
||||||
<2-codegen 'abc-123' $REGENDOC_TMPDIR/assertion/failure_demo.py:162>:2: AssertionError
|
<2-codegen 'abc-123' $REGENDOC_TMPDIR/assertion/failure_demo.py:162>:2: AssertionError
|
||||||
_______ TestMoreErrors.test_complex_error ________
|
_______ TestMoreErrors.test_complex_error ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_complex_error(self):
|
def test_complex_error(self):
|
||||||
def f():
|
def f():
|
||||||
|
@ -456,7 +456,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:5: AssertionError
|
failure_demo.py:5: AssertionError
|
||||||
_______ TestMoreErrors.test_z1_unpack_error ________
|
_______ TestMoreErrors.test_z1_unpack_error ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_z1_unpack_error(self):
|
def test_z1_unpack_error(self):
|
||||||
l = []
|
l = []
|
||||||
|
@ -466,7 +466,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:179: ValueError
|
failure_demo.py:179: ValueError
|
||||||
_______ TestMoreErrors.test_z2_type_error ________
|
_______ TestMoreErrors.test_z2_type_error ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_z2_type_error(self):
|
def test_z2_type_error(self):
|
||||||
l = 3
|
l = 3
|
||||||
|
@ -476,7 +476,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:183: TypeError
|
failure_demo.py:183: TypeError
|
||||||
_______ TestMoreErrors.test_startswith ________
|
_______ TestMoreErrors.test_startswith ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_startswith(self):
|
def test_startswith(self):
|
||||||
s = "123"
|
s = "123"
|
||||||
|
@ -488,7 +488,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:188: AssertionError
|
failure_demo.py:188: AssertionError
|
||||||
_______ TestMoreErrors.test_startswith_nested ________
|
_______ TestMoreErrors.test_startswith_nested ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_startswith_nested(self):
|
def test_startswith_nested(self):
|
||||||
def f():
|
def f():
|
||||||
|
@ -498,13 +498,13 @@ get on the terminal - we are working on that):
|
||||||
> assert f().startswith(g())
|
> assert f().startswith(g())
|
||||||
E assert <built-in method startswith of str object at 0xdeadbeef>('456')
|
E assert <built-in method startswith of str object at 0xdeadbeef>('456')
|
||||||
E + where <built-in method startswith of str object at 0xdeadbeef> = '123'.startswith
|
E + where <built-in method startswith of str object at 0xdeadbeef> = '123'.startswith
|
||||||
E + where '123' = <function f at 0xdeadbeef>()
|
E + where '123' = <function TestMoreErrors.test_startswith_nested.<locals>.f at 0xdeadbeef>()
|
||||||
E + and '456' = <function g at 0xdeadbeef>()
|
E + and '456' = <function TestMoreErrors.test_startswith_nested.<locals>.g at 0xdeadbeef>()
|
||||||
|
|
||||||
failure_demo.py:195: AssertionError
|
failure_demo.py:195: AssertionError
|
||||||
_______ TestMoreErrors.test_global_func ________
|
_______ TestMoreErrors.test_global_func ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_global_func(self):
|
def test_global_func(self):
|
||||||
> assert isinstance(globf(42), float)
|
> assert isinstance(globf(42), float)
|
||||||
|
@ -514,18 +514,18 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:198: AssertionError
|
failure_demo.py:198: AssertionError
|
||||||
_______ TestMoreErrors.test_instance ________
|
_______ TestMoreErrors.test_instance ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_instance(self):
|
def test_instance(self):
|
||||||
self.x = 6*7
|
self.x = 6*7
|
||||||
> assert self.x != 42
|
> assert self.x != 42
|
||||||
E assert 42 != 42
|
E assert 42 != 42
|
||||||
E + where 42 = <failure_demo.TestMoreErrors instance at 0xdeadbeef>.x
|
E + where 42 = <failure_demo.TestMoreErrors object at 0xdeadbeef>.x
|
||||||
|
|
||||||
failure_demo.py:202: AssertionError
|
failure_demo.py:202: AssertionError
|
||||||
_______ TestMoreErrors.test_compare ________
|
_______ TestMoreErrors.test_compare ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_compare(self):
|
def test_compare(self):
|
||||||
> assert globf(10) < 5
|
> assert globf(10) < 5
|
||||||
|
@ -535,7 +535,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:205: AssertionError
|
failure_demo.py:205: AssertionError
|
||||||
_______ TestMoreErrors.test_try_finally ________
|
_______ TestMoreErrors.test_try_finally ________
|
||||||
|
|
||||||
self = <failure_demo.TestMoreErrors instance at 0xdeadbeef>
|
self = <failure_demo.TestMoreErrors object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_try_finally(self):
|
def test_try_finally(self):
|
||||||
x = 1
|
x = 1
|
||||||
|
@ -546,7 +546,7 @@ get on the terminal - we are working on that):
|
||||||
failure_demo.py:210: AssertionError
|
failure_demo.py:210: AssertionError
|
||||||
_______ TestCustomAssertMsg.test_single_line ________
|
_______ TestCustomAssertMsg.test_single_line ________
|
||||||
|
|
||||||
self = <failure_demo.TestCustomAssertMsg instance at 0xdeadbeef>
|
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_single_line(self):
|
def test_single_line(self):
|
||||||
class A:
|
class A:
|
||||||
|
@ -555,12 +555,12 @@ get on the terminal - we are working on that):
|
||||||
> assert A.a == b, "A.a appears not to be b"
|
> assert A.a == b, "A.a appears not to be b"
|
||||||
E AssertionError: A.a appears not to be b
|
E AssertionError: A.a appears not to be b
|
||||||
E assert 1 == 2
|
E assert 1 == 2
|
||||||
E + where 1 = <class failure_demo.A at 0xdeadbeef>.a
|
E + where 1 = <class 'failure_demo.TestCustomAssertMsg.test_single_line.<locals>.A'>.a
|
||||||
|
|
||||||
failure_demo.py:221: AssertionError
|
failure_demo.py:221: AssertionError
|
||||||
_______ TestCustomAssertMsg.test_multiline ________
|
_______ TestCustomAssertMsg.test_multiline ________
|
||||||
|
|
||||||
self = <failure_demo.TestCustomAssertMsg instance at 0xdeadbeef>
|
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_multiline(self):
|
def test_multiline(self):
|
||||||
class A:
|
class A:
|
||||||
|
@ -572,12 +572,12 @@ get on the terminal - we are working on that):
|
||||||
E or does not appear to be b
|
E or does not appear to be b
|
||||||
E one of those
|
E one of those
|
||||||
E assert 1 == 2
|
E assert 1 == 2
|
||||||
E + where 1 = <class failure_demo.A at 0xdeadbeef>.a
|
E + where 1 = <class 'failure_demo.TestCustomAssertMsg.test_multiline.<locals>.A'>.a
|
||||||
|
|
||||||
failure_demo.py:227: AssertionError
|
failure_demo.py:227: AssertionError
|
||||||
_______ TestCustomAssertMsg.test_custom_repr ________
|
_______ TestCustomAssertMsg.test_custom_repr ________
|
||||||
|
|
||||||
self = <failure_demo.TestCustomAssertMsg instance at 0xdeadbeef>
|
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_custom_repr(self):
|
def test_custom_repr(self):
|
||||||
class JSON:
|
class JSON:
|
||||||
|
|
|
@ -108,7 +108,7 @@ directory with the above conftest.py::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 0 items
|
collected 0 items
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ and when running it will see a skipped "slow" test::
|
||||||
|
|
||||||
$ py.test -rs # "-rs" means report details on the little 's'
|
$ py.test -rs # "-rs" means report details on the little 's'
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ Or run it including the ``slow`` marked test::
|
||||||
|
|
||||||
$ py.test --runslow
|
$ py.test --runslow
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ which will add the string to the test header accordingly::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
project deps: mylib-1.1
|
project deps: mylib-1.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 0 items
|
collected 0 items
|
||||||
|
@ -283,7 +283,7 @@ which will add info only when run with "--v"::
|
||||||
|
|
||||||
$ py.test -v
|
$ py.test -v
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
info1: did you know that ...
|
info1: did you know that ...
|
||||||
did you?
|
did you?
|
||||||
|
@ -296,7 +296,7 @@ and nothing when run plainly::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 0 items
|
collected 0 items
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ Now we can profile which test functions execute the slowest::
|
||||||
|
|
||||||
$ py.test --durations=3
|
$ py.test --durations=3
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 3 items
|
collected 3 items
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ If we run this::
|
||||||
|
|
||||||
$ py.test -rx
|
$ py.test -rx
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 4 items
|
collected 4 items
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ If we run this::
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ TestUserHandling.test_modification ________
|
_______ TestUserHandling.test_modification ________
|
||||||
|
|
||||||
self = <test_step.TestUserHandling instance at 0xdeadbeef>
|
self = <test_step.TestUserHandling object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_modification(self):
|
def test_modification(self):
|
||||||
> assert 0
|
> assert 0
|
||||||
|
@ -462,7 +462,7 @@ We can run this::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 7 items
|
collected 7 items
|
||||||
|
|
||||||
|
@ -476,14 +476,14 @@ We can run this::
|
||||||
file $REGENDOC_TMPDIR/b/test_error.py, line 1
|
file $REGENDOC_TMPDIR/b/test_error.py, line 1
|
||||||
def test_root(db): # no db here, will error out
|
def test_root(db): # no db here, will error out
|
||||||
fixture 'db' not found
|
fixture 'db' not found
|
||||||
available fixtures: recwarn, monkeypatch, cache, tmpdir_factory, tmpdir, record_xml_property, capfd, capsys, pytestconfig
|
available fixtures: cache, record_xml_property, pytestconfig, tmpdir_factory, monkeypatch, capsys, recwarn, tmpdir, capfd
|
||||||
use 'py.test --fixtures [testpath]' for help on them.
|
use 'py.test --fixtures [testpath]' for help on them.
|
||||||
|
|
||||||
$REGENDOC_TMPDIR/b/test_error.py:1
|
$REGENDOC_TMPDIR/b/test_error.py:1
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ TestUserHandling.test_modification ________
|
_______ TestUserHandling.test_modification ________
|
||||||
|
|
||||||
self = <test_step.TestUserHandling instance at 0xdeadbeef>
|
self = <test_step.TestUserHandling object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_modification(self):
|
def test_modification(self):
|
||||||
> assert 0
|
> assert 0
|
||||||
|
@ -492,21 +492,21 @@ We can run this::
|
||||||
test_step.py:9: AssertionError
|
test_step.py:9: AssertionError
|
||||||
_______ test_a1 ________
|
_______ test_a1 ________
|
||||||
|
|
||||||
db = <conftest.DB instance at 0xdeadbeef>
|
db = <conftest.DB object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_a1(db):
|
def test_a1(db):
|
||||||
> assert 0, db # to show value
|
> assert 0, db # to show value
|
||||||
E AssertionError: <conftest.DB instance at 0xdeadbeef>
|
E AssertionError: <conftest.DB object at 0xdeadbeef>
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
a/test_db.py:2: AssertionError
|
a/test_db.py:2: AssertionError
|
||||||
_______ test_a2 ________
|
_______ test_a2 ________
|
||||||
|
|
||||||
db = <conftest.DB instance at 0xdeadbeef>
|
db = <conftest.DB object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_a2(db):
|
def test_a2(db):
|
||||||
> assert 0, db # to show value
|
> assert 0, db # to show value
|
||||||
E AssertionError: <conftest.DB instance at 0xdeadbeef>
|
E AssertionError: <conftest.DB object at 0xdeadbeef>
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
a/test_db2.py:2: AssertionError
|
a/test_db2.py:2: AssertionError
|
||||||
|
@ -566,7 +566,7 @@ and run them::
|
||||||
|
|
||||||
$ py.test test_module.py
|
$ py.test test_module.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
@ -657,12 +657,12 @@ and run it::
|
||||||
|
|
||||||
$ py.test -s test_module.py
|
$ py.test -s test_module.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 3 items
|
collected 3 items
|
||||||
|
|
||||||
test_module.py E('setting up a test failed!', 'test_module.py::test_setup_fails')
|
test_module.py Esetting up a test failed! test_module.py::test_setup_fails
|
||||||
F('executing test failed', 'test_module.py::test_call_fails')
|
Fexecuting test failed test_module.py::test_call_fails
|
||||||
F
|
F
|
||||||
|
|
||||||
======= ERRORS ========
|
======= ERRORS ========
|
||||||
|
|
|
@ -75,7 +75,7 @@ marked ``smtp`` fixture function. Running the test looks like this::
|
||||||
|
|
||||||
$ py.test test_smtpsimple.py
|
$ py.test test_smtpsimple.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ marked ``smtp`` fixture function. Running the test looks like this::
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ test_ehlo ________
|
_______ test_ehlo ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_ehlo(smtp):
|
def test_ehlo(smtp):
|
||||||
response, msg = smtp.ehlo()
|
response, msg = smtp.ehlo()
|
||||||
|
@ -180,7 +180,7 @@ function (in or below the directory where ``conftest.py`` is located)::
|
||||||
def test_ehlo(smtp):
|
def test_ehlo(smtp):
|
||||||
response, msg = smtp.ehlo()
|
response, msg = smtp.ehlo()
|
||||||
assert response == 250
|
assert response == 250
|
||||||
assert "smtp.gmail.com" in msg
|
assert b"smtp.gmail.com" in msg
|
||||||
assert 0 # for demo purposes
|
assert 0 # for demo purposes
|
||||||
|
|
||||||
def test_noop(smtp):
|
def test_noop(smtp):
|
||||||
|
@ -193,7 +193,7 @@ inspect what is going on and can now run the tests::
|
||||||
|
|
||||||
$ py.test test_module.py
|
$ py.test test_module.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
@ -202,19 +202,19 @@ inspect what is going on and can now run the tests::
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ test_ehlo ________
|
_______ test_ehlo ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_ehlo(smtp):
|
def test_ehlo(smtp):
|
||||||
response, msg = smtp.ehlo()
|
response, msg = smtp.ehlo()
|
||||||
assert response == 250
|
assert response == 250
|
||||||
assert "smtp.gmail.com" in msg
|
assert b"smtp.gmail.com" in msg
|
||||||
> assert 0 # for demo purposes
|
> assert 0 # for demo purposes
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
test_module.py:6: AssertionError
|
test_module.py:6: AssertionError
|
||||||
_______ test_noop ________
|
_______ test_noop ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_noop(smtp):
|
def test_noop(smtp):
|
||||||
response, msg = smtp.noop()
|
response, msg = smtp.noop()
|
||||||
|
@ -313,7 +313,7 @@ We use the ``request.module`` attribute to optionally obtain an
|
||||||
again, nothing much has changed::
|
again, nothing much has changed::
|
||||||
|
|
||||||
$ py.test -s -q --tb=no
|
$ py.test -s -q --tb=no
|
||||||
FFfinalizing <smtplib.SMTP instance at 0xdeadbeef> (smtp.gmail.com)
|
FFfinalizing <smtplib.SMTP object at 0xdeadbeef> (smtp.gmail.com)
|
||||||
|
|
||||||
2 failed in 0.12 seconds
|
2 failed in 0.12 seconds
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ Running it::
|
||||||
_______ test_showhelo ________
|
_______ test_showhelo ________
|
||||||
test_anothersmtp.py:5: in test_showhelo
|
test_anothersmtp.py:5: in test_showhelo
|
||||||
assert 0, smtp.helo()
|
assert 0, smtp.helo()
|
||||||
E AssertionError: (250, 'mail.python.org')
|
E AssertionError: (250, b'mail.python.org')
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
voila! The ``smtp`` fixture function picked up our mail server name
|
voila! The ``smtp`` fixture function picked up our mail server name
|
||||||
|
@ -383,19 +383,19 @@ So let's just do another run::
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ test_ehlo[smtp.gmail.com] ________
|
_______ test_ehlo[smtp.gmail.com] ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_ehlo(smtp):
|
def test_ehlo(smtp):
|
||||||
response, msg = smtp.ehlo()
|
response, msg = smtp.ehlo()
|
||||||
assert response == 250
|
assert response == 250
|
||||||
assert "smtp.gmail.com" in msg
|
assert b"smtp.gmail.com" in msg
|
||||||
> assert 0 # for demo purposes
|
> assert 0 # for demo purposes
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
test_module.py:6: AssertionError
|
test_module.py:6: AssertionError
|
||||||
_______ test_noop[smtp.gmail.com] ________
|
_______ test_noop[smtp.gmail.com] ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_noop(smtp):
|
def test_noop(smtp):
|
||||||
response, msg = smtp.noop()
|
response, msg = smtp.noop()
|
||||||
|
@ -406,20 +406,20 @@ So let's just do another run::
|
||||||
test_module.py:11: AssertionError
|
test_module.py:11: AssertionError
|
||||||
_______ test_ehlo[mail.python.org] ________
|
_______ test_ehlo[mail.python.org] ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_ehlo(smtp):
|
def test_ehlo(smtp):
|
||||||
response, msg = smtp.ehlo()
|
response, msg = smtp.ehlo()
|
||||||
assert response == 250
|
assert response == 250
|
||||||
> assert "smtp.gmail.com" in msg
|
> assert b"smtp.gmail.com" in msg
|
||||||
E assert 'smtp.gmail.com' in 'mail.python.org\nSIZE 51200000\nETRN\nSTARTTLS\nENHANCEDSTATUSCODES\n8BITMIME\nDSN\nSMTPUTF8'
|
E assert b'smtp.gmail.com' in b'mail.python.org\nSIZE 51200000\nETRN\nSTARTTLS\nENHANCEDSTATUSCODES\n8BITMIME\nDSN\nSMTPUTF8'
|
||||||
|
|
||||||
test_module.py:5: AssertionError
|
test_module.py:5: AssertionError
|
||||||
-------------------------- Captured stdout setup ---------------------------
|
-------------------------- Captured stdout setup ---------------------------
|
||||||
finalizing <smtplib.SMTP instance at 0xdeadbeef>
|
finalizing <smtplib.SMTP object at 0xdeadbeef>
|
||||||
_______ test_noop[mail.python.org] ________
|
_______ test_noop[mail.python.org] ________
|
||||||
|
|
||||||
smtp = <smtplib.SMTP instance at 0xdeadbeef>
|
smtp = <smtplib.SMTP object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_noop(smtp):
|
def test_noop(smtp):
|
||||||
response, msg = smtp.noop()
|
response, msg = smtp.noop()
|
||||||
|
@ -480,7 +480,7 @@ Running the above tests results in the following test IDs being used::
|
||||||
|
|
||||||
$ py.test --collect-only
|
$ py.test --collect-only
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 10 items
|
collected 10 items
|
||||||
<Module 'test_anothersmtp.py'>
|
<Module 'test_anothersmtp.py'>
|
||||||
|
@ -531,7 +531,7 @@ Here we declare an ``app`` fixture which receives the previously defined
|
||||||
|
|
||||||
$ py.test -v test_appsetup.py
|
$ py.test -v test_appsetup.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 2 items
|
collecting ... collected 2 items
|
||||||
|
@ -597,28 +597,28 @@ Let's run the tests in verbose mode and with looking at the print-output::
|
||||||
|
|
||||||
$ py.test -v -s test_module.py
|
$ py.test -v -s test_module.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python2.7
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
|
||||||
cachedir: .cache
|
cachedir: .cache
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collecting ... collected 8 items
|
collecting ... collected 8 items
|
||||||
|
|
||||||
test_module.py::test_0[1] (' test0', 1)
|
test_module.py::test_0[1] test0 1
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_0[2] (' test0', 2)
|
test_module.py::test_0[2] test0 2
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_1[mod1] ('create', 'mod1')
|
test_module.py::test_1[mod1] create mod1
|
||||||
(' test1', 'mod1')
|
test1 mod1
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_2[1-mod1] (' test2', 1, 'mod1')
|
test_module.py::test_2[1-mod1] test2 1 mod1
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_2[2-mod1] (' test2', 2, 'mod1')
|
test_module.py::test_2[2-mod1] test2 2 mod1
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_1[mod2] ('create', 'mod2')
|
test_module.py::test_1[mod2] create mod2
|
||||||
(' test1', 'mod2')
|
test1 mod2
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_2[1-mod2] (' test2', 1, 'mod2')
|
test_module.py::test_2[1-mod2] test2 1 mod2
|
||||||
PASSED
|
PASSED
|
||||||
test_module.py::test_2[2-mod2] (' test2', 2, 'mod2')
|
test_module.py::test_2[2-mod2] test2 2 mod2
|
||||||
PASSED
|
PASSED
|
||||||
|
|
||||||
======= 8 passed in 0.12 seconds ========
|
======= 8 passed in 0.12 seconds ========
|
||||||
|
|
|
@ -27,7 +27,7 @@ Installation options::
|
||||||
To check your installation has installed the correct version::
|
To check your installation has installed the correct version::
|
||||||
|
|
||||||
$ py.test --version
|
$ py.test --version
|
||||||
This is pytest version 2.8.1.dev1, imported from $PYTHON_PREFIX/lib/python2.7/site-packages/pytest.pyc
|
This is pytest version 2.8.1.dev1, imported from $PYTHON_PREFIX/lib/python3.4/site-packages/pytest.py
|
||||||
|
|
||||||
If you get an error checkout :ref:`installation issues`.
|
If you get an error checkout :ref:`installation issues`.
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ That's it. You can execute the test function now::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ run the module by passing its filename::
|
||||||
======= FAILURES ========
|
======= FAILURES ========
|
||||||
_______ TestClass.test_two ________
|
_______ TestClass.test_two ________
|
||||||
|
|
||||||
self = <test_class.TestClass instance at 0xdeadbeef>
|
self = <test_class.TestClass object at 0xdeadbeef>
|
||||||
|
|
||||||
def test_two(self):
|
def test_two(self):
|
||||||
x = "hello"
|
x = "hello"
|
||||||
|
|
|
@ -55,7 +55,7 @@ them in turn::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 3 items
|
collected 3 items
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ Let's run this::
|
||||||
|
|
||||||
$ py.test
|
$ py.test
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 3 items
|
collected 3 items
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ listlist::
|
||||||
$ py.test -q -rs test_strings.py
|
$ py.test -q -rs test_strings.py
|
||||||
s
|
s
|
||||||
======= short test summary info ========
|
======= short test summary info ========
|
||||||
SKIP [1] $PYTHON_PREFIX/lib/python2.7/site-packages/_pytest/python.py:1322: got empty parameter set, function test_valid_string at $REGENDOC_TMPDIR/test_strings.py:1
|
SKIP [1] $PYTHON_PREFIX/lib/python3.4/site-packages/_pytest/python.py:1322: got empty parameter set, function test_valid_string at $REGENDOC_TMPDIR/test_strings.py:1
|
||||||
1 skipped in 0.12 seconds
|
1 skipped in 0.12 seconds
|
||||||
|
|
||||||
For further examples, you might want to look at :ref:`more
|
For further examples, you might want to look at :ref:`more
|
||||||
|
|
|
@ -165,7 +165,7 @@ Running it with the report-on-xfail option gives this output::
|
||||||
|
|
||||||
example $ py.test -rx xfail_demo.py
|
example $ py.test -rx xfail_demo.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR/example, inifile:
|
rootdir: $REGENDOC_TMPDIR/example, inifile:
|
||||||
collected 7 items
|
collected 7 items
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ Running this would result in a passed test except for the last
|
||||||
|
|
||||||
$ py.test test_tmpdir.py
|
$ py.test test_tmpdir.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 1 items
|
collected 1 items
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ the ``self.db`` values in the traceback::
|
||||||
|
|
||||||
$ py.test test_unittest_db.py
|
$ py.test test_unittest_db.py
|
||||||
======= test session starts ========
|
======= test session starts ========
|
||||||
platform linux2 -- Python 2.7.10, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
collected 2 items
|
collected 2 items
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ the ``self.db`` values in the traceback::
|
||||||
def test_method1(self):
|
def test_method1(self):
|
||||||
assert hasattr(self, "db")
|
assert hasattr(self, "db")
|
||||||
> assert 0, self.db # fail for demo purposes
|
> assert 0, self.db # fail for demo purposes
|
||||||
E AssertionError: <conftest.DummyDB instance at 0xdeadbeef>
|
E AssertionError: <conftest.db_class.<locals>.DummyDB object at 0xdeadbeef>
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
test_unittest_db.py:9: AssertionError
|
test_unittest_db.py:9: AssertionError
|
||||||
|
@ -112,7 +112,7 @@ the ``self.db`` values in the traceback::
|
||||||
|
|
||||||
def test_method2(self):
|
def test_method2(self):
|
||||||
> assert 0, self.db # fail for demo purposes
|
> assert 0, self.db # fail for demo purposes
|
||||||
E AssertionError: <conftest.DummyDB instance at 0xdeadbeef>
|
E AssertionError: <conftest.db_class.<locals>.DummyDB object at 0xdeadbeef>
|
||||||
E assert 0
|
E assert 0
|
||||||
|
|
||||||
test_unittest_db.py:12: AssertionError
|
test_unittest_db.py:12: AssertionError
|
||||||
|
|
Loading…
Reference in New Issue