Merge pull request #2850 from bilderbuchi/docs-911
Add documentation about python -m pytest invocation.
This commit is contained in:
commit
4cb60dac3d
|
@ -0,0 +1 @@
|
||||||
|
Add documentation about the ``python -m pytest`` invocation adding the current directory to sys.path.
|
|
@ -68,4 +68,9 @@ imported in the global import namespace.
|
||||||
|
|
||||||
This is also discussed in details in :ref:`test discovery`.
|
This is also discussed in details in :ref:`test discovery`.
|
||||||
|
|
||||||
|
Invoking ``pytest`` versus ``python -m pytest``
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
Running pytest with ``python -m pytest [...]`` instead of ``pytest [...]`` yields nearly
|
||||||
|
equivalent behaviour, except that the former call will add the current directory to ``sys.path``.
|
||||||
|
See also :ref:`cmdline`.
|
||||||
|
|
|
@ -17,7 +17,7 @@ You can invoke testing through the Python interpreter from the command line::
|
||||||
python -m pytest [...]
|
python -m pytest [...]
|
||||||
|
|
||||||
This is almost equivalent to invoking the command line script ``pytest [...]``
|
This is almost equivalent to invoking the command line script ``pytest [...]``
|
||||||
directly, except that Python will also add the current directory to ``sys.path``.
|
directly, except that calling via ``python`` will also add the current directory to ``sys.path``.
|
||||||
|
|
||||||
Possible exit codes
|
Possible exit codes
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue