diff options
author | boris <boris@verhovs.ky> | 2019-08-06 16:18:06 -0700 |
---|---|---|
committer | boris <boris@verhovs.ky> | 2019-08-06 16:18:06 -0700 |
commit | 23a0b532dbe72d6cb6ec923d9ce6f0a63a34fc28 (patch) | |
tree | 681fb33747fc5a3be3ff747ccc9978207df69cb7 /doc/en/funcarg_compare.rst | |
parent | 9fce0bdd88c425aa7b98dc4cc0c2696c19fdbd95 (diff) | |
download | pytest-23a0b532dbe72d6cb6ec923d9ce6f0a63a34fc28.tar.gz |
Revert "remove implicit code tags .replace("::\n\n.. code-block", "\n\n.. code-block")"
This reverts commit 9fce0bdd88c425aa7b98dc4cc0c2696c19fdbd95.
Diffstat (limited to 'doc/en/funcarg_compare.rst')
-rw-r--r-- | doc/en/funcarg_compare.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/en/funcarg_compare.rst b/doc/en/funcarg_compare.rst index d802dd585..2f6e7a1ec 100644 --- a/doc/en/funcarg_compare.rst +++ b/doc/en/funcarg_compare.rst @@ -21,7 +21,7 @@ funcarg for a test function is required. If a factory wants to re-use a resource across different scopes, it often used the ``request.cached_setup()`` helper to manage caching of resources. Here is a basic example how we could implement -a per-session Database object +a per-session Database object:: .. code-block:: python @@ -72,7 +72,7 @@ Direct scoping of fixture/funcarg factories Instead of calling cached_setup() with a cache scope, you can use the :ref:`@pytest.fixture <pytest.fixture>` decorator and directly state -the scope +the scope:: .. code-block:: python @@ -96,7 +96,7 @@ Previously, funcarg factories could not directly cause parametrization. You needed to specify a ``@parametrize`` decorator on your test function or implement a ``pytest_generate_tests`` hook to perform parametrization, i.e. calling a test multiple times with different value -sets. pytest-2.3 introduces a decorator for use on the factory itself +sets. pytest-2.3 introduces a decorator for use on the factory itself:: .. code-block:: python @@ -115,7 +115,7 @@ allow to re-use already written factories because effectively parametrized via :py:func:`~_pytest.python.Metafunc.parametrize(indirect=True)` calls. -Of course it's perfectly fine to combine parametrization and scoping +Of course it's perfectly fine to combine parametrization and scoping:: .. code-block:: python @@ -138,7 +138,7 @@ No ``pytest_funcarg__`` prefix when using @fixture decorator When using the ``@fixture`` decorator the name of the function denotes the name under which the resource can be accessed as a function -argument +argument:: .. code-block:: python @@ -149,7 +149,7 @@ argument The name under which the funcarg resource can be requested is ``db``. You can still use the "old" non-decorator way of specifying funcarg factories -aka +aka:: .. code-block:: python |