Skip to content

Commit 94270a0

Browse files
committed
docs warnings as errors and initial page similar to README
* Changed "index" to be more similar to the README (#1708). * Fixes numerous issues like missing documents, syntax errors, etc (#1829, #432). * Mention all docs in "contents.rst" so it's easier for users to locate (#1112). * Add doc generation and checking to Travis and AppVeyor, to avoid re-introducing errors. Fixes #432, Fixes #1112, Fixes #1708, Fixes #1829
1 parent d99ceb1 commit 94270a0

32 files changed

+232
-355
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
- TESTENV=py27-nobyte
2727
- TESTENV=doctesting
2828
- TESTENV=freeze
29+
- TESTENV=docs
2930

3031
script: tox --recreate -e $TESTENV
3132

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To execute it::
5252
======= 1 failed in 0.12 seconds ========
5353

5454

55-
Due to ``py.test``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <http://docs.pytest.org/en/latest/getting-started.html#our-first-test-run>`_ for more examples.
55+
Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <http://docs.pytest.org/en/latest/getting-started.html#our-first-test-run>`_ for more examples.
5656

5757

5858
Features

_pytest/python.py

+11-16
Original file line numberDiff line numberDiff line change
@@ -711,31 +711,26 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
711711
They help to inspect a test function and to generate tests according to
712712
test configuration or values specified in the class or module where a
713713
test function is defined.
714-
715-
:ivar fixturenames: set of fixture names required by the test function
716-
717-
:ivar function: underlying python test function
718-
719-
:ivar cls: class object where the test function is defined in or ``None``.
720-
721-
:ivar module: the module object where the test function is defined in.
722-
723-
:ivar config: access to the :class:`_pytest.config.Config` object for the
724-
test session.
725-
726-
:ivar funcargnames:
727-
.. deprecated:: 2.3
728-
Use ``fixturenames`` instead.
729714
"""
730715
def __init__(self, function, fixtureinfo, config, cls=None, module=None):
716+
#: access to the :class:`_pytest.config.Config` object for the test session
731717
self.config = config
718+
719+
#: the module object where the test function is defined in.
732720
self.module = module
721+
722+
#: underlying python test function
733723
self.function = function
724+
725+
#: set of fixture names required by the test function
734726
self.fixturenames = fixtureinfo.names_closure
735-
self._arg2fixturedefs = fixtureinfo.name2fixturedefs
727+
728+
#: class object where the test function is defined in or ``None``.
736729
self.cls = cls
730+
737731
self._calls = []
738732
self._ids = py.builtin.set()
733+
self._arg2fixturedefs = fixtureinfo.name2fixturedefs
739734

740735
def parametrize(self, argnames, argvalues, indirect=False, ids=None,
741736
scope=None):

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
# builds timing out in AppVeyor
1111
- TOXENV: "linting,py26,py27,py33,py34,py35,pypy"
1212
- TOXENV: "py27-pexpect,py27-xdist,py27-trial,py35-pexpect,py35-xdist,py35-trial"
13-
- TOXENV: "py27-nobyte,doctesting,freeze"
13+
- TOXENV: "py27-nobyte,doctesting,freeze,docs"
1414

1515
install:
1616
- echo Installed Pythons

doc/en/adopt.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
:orphan:
12

23
April 2015 is "adopt pytest month"
34
=============================================

doc/en/announce/release-2.9.1.rst

+2
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ The py.test Development Team
6363
.. _#649: https://github.com/pytest-dev/pytest/issues/649
6464

6565
.. _@asottile: https://github.com/asottile
66+
.. _@nicoddemus: https://github.com/nicoddemus
67+
.. _@tomviner: https://github.com/tomviner

doc/en/announce/release-2.9.2.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,10 @@ The py.test Development Team
6969
.. _#1496: https://github.com/pytest-dev/pytest/issue/1496
7070
.. _#1524: https://github.com/pytest-dev/pytest/issue/1524
7171

72-
.. _@prusse-martin: https://github.com/prusse-martin
7372
.. _@astraw38: https://github.com/astraw38
73+
.. _@hackebrot: https://github.com/hackebrot
74+
.. _@omarkohl: https://github.com/omarkohl
75+
.. _@pquentin: https://github.com/pquentin
76+
.. _@prusse-martin: https://github.com/prusse-martin
77+
.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
78+
.. _@tomviner: https://github.com/tomviner

doc/en/announce/sprint2016.rst

-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ Over 20 participants took part from 4 continents, including employees
3939
from Splunk, Personalkollen, Cobe.io, FanDuel and Dolby. Some newcomers
4040
mixed with developers who have worked on pytest since its beginning, and
4141
of course everyone in between.
42-
Ana Ribeiro, Brazil
43-
Ronny Pfannschmidt, Germany
4442

4543

4644
Sprint organisation, schedule

doc/en/assert.rst

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ It is possible to add your own detailed explanations by implementing
208208
the ``pytest_assertrepr_compare`` hook.
209209

210210
.. autofunction:: _pytest.hookspec.pytest_assertrepr_compare
211+
:noindex:
211212

212213
As an example consider adding the following hook in a conftest.py which
213214
provides an alternative explanation for ``Foo`` objects::

doc/en/builtin.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ Fixtures and requests
5858

5959
To mark a fixture function:
6060

61-
.. autofunction:: _pytest.python.fixture
61+
.. autofunction:: _pytest.fixtures.fixture
6262

6363
Tutorial at :ref:`fixtures`.
6464

6565
The ``request`` object that can be used from fixture functions.
6666

67-
.. autoclass:: _pytest.python.FixtureRequest()
67+
.. autoclass:: _pytest.fixtures.FixtureRequest()
6868
:members:
6969

7070

doc/en/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127

128128
# The name for this set of Sphinx documents. If None, it defaults to
129129
# "<project> v<release> documentation".
130-
html_title = None
130+
html_title = 'pytest documentation'
131131

132132
# A shorter title for the navigation bar. Default is the same as html_title.
133133
html_short_title = "pytest-%s" % release
@@ -144,7 +144,7 @@
144144
# Add any paths that contain custom static files (such as style sheets) here,
145145
# relative to this directory. They are copied after the builtin static files,
146146
# so a file named "default.css" will overwrite the builtin "default.css".
147-
html_static_path = ['_static']
147+
# html_static_path = ['_static']
148148

149149
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
150150
# using the given strftime format.

doc/en/contents.rst

+24-5
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,51 @@ Full pytest documentation
1010
.. toctree::
1111
:maxdepth: 2
1212

13-
overview
14-
apiref
15-
example/index
13+
getting-started
14+
usage
15+
assert
16+
builtin
17+
fixture
1618
monkeypatch
1719
tmpdir
1820
capture
1921
recwarn
22+
doctest
23+
mark
24+
skipping
25+
parametrize
2026
cache
21-
plugins
27+
unittest
2228
nose
29+
xunit_setup
30+
plugins
31+
writing_plugins
32+
33+
example/index
34+
goodpractices
35+
customize
36+
bash-completion
2337

2438
backwards-compatibility
39+
license
2540
contributing
2641
talks
42+
projects
43+
faq
44+
contact
2745

2846
.. only:: html
2947

3048
.. toctree::
49+
:maxdepth: 1
3150

32-
funcarg_compare
3351
announce/index
3452

3553
.. only:: html
3654

3755
.. toctree::
3856
:hidden:
57+
:maxdepth: 1
3958

4059
changelog
4160

doc/en/doctest.rst

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ from docstrings in all python modules (including regular
1616
python test modules)::
1717

1818
pytest --doctest-modules
19+
1920
You can make these changes permanent in your project by
2021
putting them into a pytest.ini file like this:
2122

doc/en/example/reportingdemo.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ Demo of Python failure reports with pytest
77
Here is a nice run of several tens of failures
88
and how ``pytest`` presents things (unfortunately
99
not showing the nice colors here in the HTML that you
10-
get on the terminal - we are working on that):
10+
get on the terminal - we are working on that)::
1111

12-
.. code-block:: python
13-
14-
assertion $ pytest failure_demo.py
12+
$ pytest failure_demo.py
1513
======= test session starts ========
1614
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
1715
rootdir: $REGENDOC_TMPDIR/assertion, inifile:

0 commit comments

Comments
 (0)