From e24031fb3627ae6c187ea476c99a5f6d90e876f6 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 5 Jan 2019 20:42:44 +0000 Subject: [PATCH] Regendocs again, without hypothesis --- doc/en/assert.rst | 4 ---- doc/en/cache.rst | 6 ------ doc/en/capture.rst | 2 -- doc/en/doctest.rst | 2 -- doc/en/example/markers.rst | 32 ----------------------------- doc/en/example/nonpython.rst | 6 ------ doc/en/example/parametrize.rst | 14 ------------- doc/en/example/pythoncollection.rst | 6 ------ doc/en/example/reportingdemo.rst | 2 -- doc/en/example/simple.rst | 22 -------------------- doc/en/fixture.rst | 12 ----------- doc/en/getting-started.rst | 4 ---- doc/en/index.rst | 2 -- doc/en/parametrize.rst | 4 ---- doc/en/skipping.rst | 2 -- doc/en/tmpdir.rst | 4 ---- doc/en/unittest.rst | 2 -- doc/en/usage.rst | 6 ------ doc/en/warnings.rst | 2 -- doc/en/writing_plugins.rst | 2 -- 20 files changed, 136 deletions(-) diff --git a/doc/en/assert.rst b/doc/en/assert.rst index 511839d88..b13a071f6 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -29,9 +29,7 @@ you will see the return value of the function call: $ pytest test_assert1.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_assert1.py F [100%] @@ -175,9 +173,7 @@ if you run this module: $ pytest test_assert2.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_assert2.py F [100%] diff --git a/doc/en/cache.rst b/doc/en/cache.rst index caa170027..ba9d87a5f 100644 --- a/doc/en/cache.rst +++ b/doc/en/cache.rst @@ -81,9 +81,7 @@ If you then run it with ``--lf``: $ pytest --lf =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 50 items / 48 deselected run-last-failure: rerun previous 2 failures @@ -126,9 +124,7 @@ of ``FF`` and dots): $ pytest --ff =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 50 items run-last-failure: rerun previous 2 failures first @@ -257,9 +253,7 @@ You can always peek at the content of the cache using the $ pytest --cache-show =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y cachedir: $REGENDOC_TMPDIR/.pytest_cache ------------------------------- cache values ------------------------------- cache/lastfailed contains: diff --git a/doc/en/capture.rst b/doc/en/capture.rst index 7d452b9f9..488b2b874 100644 --- a/doc/en/capture.rst +++ b/doc/en/capture.rst @@ -68,9 +68,7 @@ of the failing function and hide the other one: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_module.py .F [100%] diff --git a/doc/en/doctest.rst b/doc/en/doctest.rst index 69a9cd18a..125ed3aa7 100644 --- a/doc/en/doctest.rst +++ b/doc/en/doctest.rst @@ -65,9 +65,7 @@ then you can just invoke ``pytest`` without command line options: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini - plugins: hypothesis-3.x.y collected 1 item mymodule.py . [100%] diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 637640062..9d325c30e 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -35,9 +35,7 @@ You can then restrict a test run to only run tests marked with ``webtest``: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 4 items / 3 deselected test_server.py::test_send_http PASSED [100%] @@ -52,9 +50,7 @@ Or the inverse, running all tests except the webtest ones: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 4 items / 1 deselected test_server.py::test_something_quick PASSED [ 33%] @@ -76,9 +72,7 @@ tests based on their module, class, method, or function name: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 1 item test_server.py::TestClass::test_method PASSED [100%] @@ -93,9 +87,7 @@ You can also select on the class: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 1 item test_server.py::TestClass::test_method PASSED [100%] @@ -110,9 +102,7 @@ Or select multiple nodes: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 2 items test_server.py::TestClass::test_method PASSED [ 50%] @@ -152,9 +142,7 @@ select tests based on their names: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 4 items / 3 deselected test_server.py::test_send_http PASSED [100%] @@ -169,9 +157,7 @@ And you can also run all tests except the ones that match the keyword: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 4 items / 1 deselected test_server.py::test_something_quick PASSED [ 33%] @@ -188,9 +174,7 @@ Or to select "http" and "quick" tests: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 4 items / 2 deselected test_server.py::test_send_http PASSED [ 50%] @@ -232,8 +216,6 @@ 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.filterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/latest/warnings.html#pytest-mark-filterwarnings @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. @@ -383,9 +365,7 @@ the test needs: $ pytest -E stage2 =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_someenv.py s [100%] @@ -399,9 +379,7 @@ and here is one that specifies exactly the environment needed: $ pytest -E stage1 =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_someenv.py . [100%] @@ -413,8 +391,6 @@ 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.filterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/latest/warnings.html#pytest-mark-filterwarnings @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. @@ -570,9 +546,7 @@ then you will see two tests skipped and two executed tests as expected: $ pytest -rs # this option reports skip reasons =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items test_plat.py s.s. [100%] @@ -588,9 +562,7 @@ Note that if you specify a platform via the marker-command line option like this $ pytest -m linux =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items / 3 deselected test_plat.py . [100%] @@ -643,9 +615,7 @@ We can now use the ``-m option`` to select one set: $ pytest -m interface --tb=short =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items / 2 deselected test_module.py FF [100%] @@ -668,9 +638,7 @@ or to select both "event" and "interface" tests: $ pytest -m "interface or event" --tb=short =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items / 1 deselected test_module.py FFF [100%] diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index 3db466391..eba8279f3 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -30,9 +30,7 @@ now execute the test specification: nonpython $ pytest test_simple.yml =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/nonpython/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR/nonpython, inifile: - plugins: hypothesis-3.x.y collected 2 items test_simple.yml F. [100%] @@ -67,9 +65,7 @@ consulted when reporting in ``verbose`` mode: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/nonpython/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR/nonpython, inifile: - plugins: hypothesis-3.x.y collecting ... collected 2 items test_simple.yml::hello FAILED [ 50%] @@ -92,9 +88,7 @@ interesting to just look at the collection tree: nonpython $ pytest --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/nonpython/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR/nonpython, inifile: - plugins: hypothesis-3.x.y collected 2 items diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 133add2c6..92756e492 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -145,9 +145,7 @@ objects, they are still using the default pytest representation: $ pytest test_time.py --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 8 items @@ -205,9 +203,7 @@ this is a fully self-contained example which you can run with: $ pytest test_scenarios.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items test_scenarios.py .... [100%] @@ -221,9 +217,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia $ pytest --collect-only test_scenarios.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items @@ -289,9 +283,7 @@ Let's first see how it looks like at collection time: $ pytest test_backends.py --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items @@ -356,9 +348,7 @@ The result of this test will be successful: $ pytest test_indirect_list.py --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item @@ -492,9 +482,7 @@ If you run this with reporting for skips enabled: $ pytest -rs test_module.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_module.py .s [100%] @@ -552,9 +540,7 @@ Then run ``pytest`` with verbose mode and with only the ``basic`` marker: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 17 items / 14 deselected test_pytest_param_example.py::test_eval[1+7-8] PASSED [ 33%] diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 53e7cd321..394924e2d 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -132,9 +132,7 @@ The test collection would look like this: $ pytest --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini - plugins: hypothesis-3.x.y collected 2 items @@ -189,9 +187,7 @@ You can always peek at the collection tree without running tests like this: . $ pytest --collect-only pythoncollection.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/CWD/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini - plugins: hypothesis-3.x.y collected 3 items @@ -263,9 +259,7 @@ file will be left out: $ pytest --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini - plugins: hypothesis-3.x.y collected 0 items ======================= no tests ran in 0.12 seconds ======================= diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index c40e15572..15d71caa0 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -14,9 +14,7 @@ get on the terminal - we are working on that): assertion $ pytest failure_demo.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/assertion/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR/assertion, inifile: - plugins: hypothesis-3.x.y collected 44 items failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [100%] diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 6d06856d1..76a1ddc80 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -128,9 +128,7 @@ directory with the above conftest.py: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 0 items ======================= no tests ran in 0.12 seconds ======================= @@ -190,9 +188,7 @@ and when running it will see a skipped "slow" test: $ pytest -rs # "-rs" means report details on the little 's' =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_module.py .s [100%] @@ -208,9 +204,7 @@ Or run it including the ``slow`` marked test: $ pytest --runslow =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_module.py .. [100%] @@ -352,10 +346,8 @@ which will add the string to the test header accordingly: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') project deps: mylib-1.1 rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 0 items ======================= no tests ran in 0.12 seconds ======================= @@ -383,11 +375,9 @@ which will add info only when run with "--v": =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') 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 ======================= @@ -399,9 +389,7 @@ and nothing when run plainly: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 0 items ======================= no tests ran in 0.12 seconds ======================= @@ -440,9 +428,7 @@ Now we can profile which test functions execute the slowest: $ pytest --durations=3 =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 3 items test_some_are_slow.py ... [100%] @@ -516,9 +502,7 @@ If we run this: $ pytest -rx =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 4 items test_step.py .Fx. [100%] @@ -601,9 +585,7 @@ We can run this: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 7 items test_step.py .Fx. [ 57%] @@ -716,9 +698,7 @@ and run them: $ pytest test_module.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_module.py FF [100%] @@ -819,9 +799,7 @@ and run it: $ pytest -s test_module.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') 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 diff --git a/doc/en/fixture.rst b/doc/en/fixture.rst index 9f13875d5..4dd68f8e4 100644 --- a/doc/en/fixture.rst +++ b/doc/en/fixture.rst @@ -73,9 +73,7 @@ marked ``smtp_connection`` fixture function. Running the test looks like this: $ pytest test_smtpsimple.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_smtpsimple.py F [100%] @@ -215,9 +213,7 @@ inspect what is going on and can now run the tests: $ pytest test_module.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_module.py FF [100%] @@ -705,9 +701,7 @@ Running the above tests results in the following test IDs being used: $ pytest --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 10 items @@ -752,9 +746,7 @@ Running this test will *skip* the invocation of ``data_set`` with value ``2``: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 3 items test_fixture_marks.py::test_data[0] PASSED [ 33%] @@ -799,9 +791,7 @@ Here we declare an ``app`` fixture which receives the previously defined =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 2 items test_appsetup.py::test_smtp_connection_exists[smtp.gmail.com] PASSED [ 50%] @@ -872,9 +862,7 @@ Let's run the tests in verbose mode and with looking at the print-output: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collecting ... collected 8 items test_module.py::test_0[1] SETUP otherarg 1 diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index cf94b93f4..500fc3d93 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -25,8 +25,6 @@ Install ``pytest`` $ pytest --version This is pytest version 4.x.y, imported from $PYTHON_PREFIX/lib/python3.6/site-packages/pytest.py - setuptools registered plugins: - hypothesis-3.x.y at $PYTHON_PREFIX/lib/python3.6/site-packages/hypothesis/extra/pytestplugin.py .. _`simpletest`: @@ -49,9 +47,7 @@ That’s it. You can now execute the test function: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_sample.py F [100%] diff --git a/doc/en/index.rst b/doc/en/index.rst index 414503e17..7c201fbd7 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -29,9 +29,7 @@ To execute it: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_sample.py F [100%] diff --git a/doc/en/parametrize.rst b/doc/en/parametrize.rst index 500c5619f..099b531c2 100644 --- a/doc/en/parametrize.rst +++ b/doc/en/parametrize.rst @@ -57,9 +57,7 @@ them in turn: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 3 items test_expectation.py ..F [100%] @@ -110,9 +108,7 @@ Let's run this: $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 3 items test_expectation.py ..x [100%] diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst index 978f4dc5c..ae1dc7149 100644 --- a/doc/en/skipping.rst +++ b/doc/en/skipping.rst @@ -330,9 +330,7 @@ Running it with the report-on-xfail option gives this output: example $ pytest -rx xfail_demo.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/example/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR/example, inifile: - plugins: hypothesis-3.x.y collected 7 items xfail_demo.py xxxxxxx [100%] diff --git a/doc/en/tmpdir.rst b/doc/en/tmpdir.rst index 7db848280..8c21e17e5 100644 --- a/doc/en/tmpdir.rst +++ b/doc/en/tmpdir.rst @@ -42,9 +42,7 @@ Running this would result in a passed test except for the last $ pytest test_tmp_path.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_tmp_path.py F [100%] @@ -106,9 +104,7 @@ Running this would result in a passed test except for the last $ pytest test_tmpdir.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_tmpdir.py F [100%] diff --git a/doc/en/unittest.rst b/doc/en/unittest.rst index ff4e73a96..34c8a35db 100644 --- a/doc/en/unittest.rst +++ b/doc/en/unittest.rst @@ -129,9 +129,7 @@ the ``self.db`` values in the traceback: $ pytest test_unittest_db.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 2 items test_unittest_db.py FF [100%] diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 9fa3d6456..3ff6a0dd5 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -193,9 +193,7 @@ Example: $ pytest -ra =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 6 items test_example.py .FEsxX [100%] @@ -246,9 +244,7 @@ More than one character can be used, so for example to only see failed and skipp $ pytest -rfs =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 6 items test_example.py .FEsxX [100%] @@ -283,9 +279,7 @@ captured output: $ pytest -rpP =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 6 items test_example.py .FEsxX [100%] diff --git a/doc/en/warnings.rst b/doc/en/warnings.rst index 601459f1c..3e69d3480 100644 --- a/doc/en/warnings.rst +++ b/doc/en/warnings.rst @@ -25,9 +25,7 @@ Running pytest now produces this output: $ pytest test_show_warnings.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: - plugins: hypothesis-3.x.y collected 1 item test_show_warnings.py . [100%] diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index d23a15e00..70bf315aa 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -413,9 +413,7 @@ additionally it is possible to copy examples for an example folder before runnin $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y - hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('$REGENDOC_TMPDIR/.hypothesis/examples') rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini - plugins: hypothesis-3.x.y collected 2 items test_example.py .. [100%]