diff --git a/doc/en/customize.rst b/doc/en/customize.rst index 3b060a715..e1d8fc571 100644 --- a/doc/en/customize.rst +++ b/doc/en/customize.rst @@ -49,7 +49,7 @@ Here is the algorithm which finds the rootdir from ``args``: a package and don't have any particular ini-file configuration. If no ``args`` are given, pytest collects test below the current working -directory and also starts determining the rootdir from there. +directory and also starts determining the rootdir from there. :warning: custom pytest plugin commandline arguments may include a path, as in ``pytest --log-output ../../test.log args``. Then ``args`` is mandatory, @@ -97,18 +97,7 @@ check for ini-files as follows:: .. _`how to change command line options defaults`: .. _`adding default options`: -Change which files are added to sys.path ------------------------------------------------ -If you place a conftest.py file in the root directory of your project -(as determined by pytest, see above.) pytest will run tests against -the code below that directory by adding it to your sys.path instead of -running against your installed code. - -You may find yourself wanting to do this if you ran `python setup.py install` -to set up your project, as opposed to `python setup.py develop` or any of -the package manager equivalents. Installing with develop in a -virtual environment is recommended over using the conftest.py pattern. How to change command line options defaults ------------------------------------------------ diff --git a/doc/en/goodpractices.rst b/doc/en/goodpractices.rst index 9e8811c7f..92cd9ed81 100644 --- a/doc/en/goodpractices.rst +++ b/doc/en/goodpractices.rst @@ -104,11 +104,9 @@ sub-directory of your root:: This layout prevents a lot of common pitfalls and has many benefits, which are better explained in this excellent `blog post by Ionel Cristian Mărieș `_. - Tests as part of application code ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Inlining test directories into your application package is useful if you have direct relation between tests and application modules and want to distribute them along with your application:: @@ -189,7 +187,7 @@ You can then install your package in "editable" mode:: pip install -e . which lets you change your source code (both tests and application) and rerun tests at will. -This is similar to running `python setup.py develop` or `conda develop` in that it installs +This is similar to running `python setup.py develop` or `conda develop` in that it installs your package using a symlink to your development code. Once you are done with your work and want to make sure that your actual diff --git a/doc/en/nose.rst b/doc/en/nose.rst index a785ecfaa..dcceff9b6 100644 --- a/doc/en/nose.rst +++ b/doc/en/nose.rst @@ -50,6 +50,16 @@ Unsupported idioms / known issues but there is discussion in `issue268 `_ for adding some support. Note that `nose2 choose to avoid this sys.path/import hackery `_. + If you place a conftest.py file in the root directory of your project + (as determined by pytest) pytest will run tests "nose style" against + the code below that directory by adding it to your sys.path instead of + running against your installed code. + + You may find yourself wanting to do this if you ran `python setup.py install` + to set up your project, as opposed to `python setup.py develop` or any of + the package manager equivalents. Installing with develop in a + virtual environment like Tox is recommended over this pattern. + - nose-style doctests are not collected and executed correctly, also doctest fixtures don't work. @@ -62,3 +72,4 @@ Unsupported idioms / known issues being the recommended alternative. +