update doc

This commit is contained in:
linchiwei123 2019-08-25 12:44:30 +08:00
parent 9859d37cf6
commit 01b9774e3b
2 changed files with 4 additions and 4 deletions

View File

@ -315,15 +315,15 @@ Consider the code below:
.. literalinclude:: example/fixtures/test_fixtures_order.py .. literalinclude:: example/fixtures/test_fixtures_order.py
The fixtures requested by ``test_foo`` will be instantiated in the following order: The fixtures requested by ``test_order`` will be instantiated in the following order:
1. ``s1``: is the highest-scoped fixture (``session``). 1. ``s1``: is the highest-scoped fixture (``session``).
2. ``m1``: is the second highest-scoped fixture (``module``). 2. ``m1``: is the second highest-scoped fixture (``module``).
3. ``a1``: is a ``function``-scoped ``autouse`` fixture: it will be instantiated before other fixtures 3. ``a1``: is a ``function``-scoped ``autouse`` fixture: it will be instantiated before other fixtures
within the same scope. within the same scope.
4. ``f3``: is a ``function``-scoped fixture, required by ``f1``: it needs to be instantiated at this point 4. ``f3``: is a ``function``-scoped fixture, required by ``f1``: it needs to be instantiated at this point
5. ``f1``: is the first ``function``-scoped fixture in ``test_foo`` parameter list. 5. ``f1``: is the first ``function``-scoped fixture in ``test_order`` parameter list.
6. ``f2``: is the last ``function``-scoped fixture in ``test_foo`` parameter list. 6. ``f2``: is the last ``function``-scoped fixture in ``test_order`` parameter list.
.. _`finalization`: .. _`finalization`:

View File

@ -50,7 +50,7 @@ these patches.
:py:meth:`monkeypatch.chdir` to change the context of the current working directory :py:meth:`monkeypatch.chdir` to change the context of the current working directory
during a test. during a test.
5. Use py:meth:`monkeypatch.syspath_prepend` to modify ``sys.path`` which will also 5. Use :py:meth:`monkeypatch.syspath_prepend` to modify ``sys.path`` which will also
call :py:meth:`pkg_resources.fixup_namespace_packages` and :py:meth:`importlib.invalidate_caches`. call :py:meth:`pkg_resources.fixup_namespace_packages` and :py:meth:`importlib.invalidate_caches`.
See the `monkeypatch blog post`_ for some introduction material See the `monkeypatch blog post`_ for some introduction material