From 3ad315bceeb29a6eb7222c5392151791057c04e5 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 15 Jul 2019 16:15:59 +0200 Subject: [PATCH 1/3] Improve CSS layout of API reference --- doc/en/_themes/flask/static/flasky.css_t | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/doc/en/_themes/flask/static/flasky.css_t b/doc/en/_themes/flask/static/flasky.css_t index ad23acf28..108c85401 100644 --- a/doc/en/_themes/flask/static/flasky.css_t +++ b/doc/en/_themes/flask/static/flasky.css_t @@ -424,12 +424,56 @@ a:hover tt { background: #EEE; } +#reference div.section h2 { + /* separate code elements in the reference section */ + border-top: 2px solid #ccc; + padding-top: 0.5em; +} + #reference div.section h3 { /* separate code elements in the reference section */ border-top: 1px solid #ccc; padding-top: 0.5em; } +dl.class, dl.function { + margin-top: 1em; + margin-bottom: 1em; +} + +dl.class > dd { + border-left: 3px solid #ccc; + margin-left: 0px; + padding-left: 30px; +} + +dl.field-list { + flex-direction: column; +} + +dl.field-list dd { + padding-left: 4em; + border-left: 3px solid #ccc; + margin-bottom: 0.5em; +} + +dl.field-list dd > ul { + list-style: none; + padding-left: 0px; +} + +dl.field-list dd > ul > li li :first-child { + text-indent: 0; +} + +dl.field-list dd > ul > li :first-child { + text-indent: -2em; + padding-left: 0px; +} + +dl.field-list dd > p:first-child { + text-indent: -2em; +} @media screen and (max-width: 870px) { From 6f1d358a0c9bd439b29049571c0594677f229a72 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 15 Jul 2019 16:16:44 +0200 Subject: [PATCH 2/3] Fix some ReST indentation issues in docstrings --- src/_pytest/mark/structures.py | 23 ++++++++++++----------- src/_pytest/python_api.py | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 0887d6b9c..c1a9e70f9 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -193,17 +193,18 @@ class MarkDecorator: pass When a MarkDecorator instance is called it does the following: - 1. If called with a single class as its only positional argument and no - additional keyword arguments, it attaches itself to the class so it - gets applied automatically to all test cases found in that class. - 2. If called with a single function as its only positional argument and - no additional keyword arguments, it attaches a MarkInfo object to the - function, containing all the arguments already stored internally in - the MarkDecorator. - 3. When called in any other case, it performs a 'fake construction' call, - i.e. it returns a new MarkDecorator instance with the original - MarkDecorator's content updated with the arguments passed to this - call. + + 1. If called with a single class as its only positional argument and no + additional keyword arguments, it attaches itself to the class so it + gets applied automatically to all test cases found in that class. + 2. If called with a single function as its only positional argument and + no additional keyword arguments, it attaches a MarkInfo object to the + function, containing all the arguments already stored internally in + the MarkDecorator. + 3. When called in any other case, it performs a 'fake construction' call, + i.e. it returns a new MarkDecorator instance with the original + MarkDecorator's content updated with the arguments passed to this + call. Note: The rules above prevent MarkDecorator objects from storing only a single function or class reference as their positional argument with no diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index cbd833946..bd0f4d59f 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -542,7 +542,7 @@ def raises(expected_exception, *args, **kwargs): string that may contain `special characters`__, the pattern can first be escaped with ``re.escape``. - __ https://docs.python.org/3/library/re.html#regular-expression-syntax + __ https://docs.python.org/3/library/re.html#regular-expression-syntax :kwparam message: **(deprecated since 4.1)** if specified, provides a custom failure message if the exception is not raised. See :ref:`the deprecation docs ` for a workaround. From bb7608c56f313096566956d87583f4e531983938 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 15 Jul 2019 16:25:33 +0200 Subject: [PATCH 3/3] Change section titles in docs --- CHANGELOG.rst | 6 +++--- doc/en/_templates/globaltoc.html | 2 +- doc/en/reference.rst | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c4ab6f1bd..3badb1936 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,6 @@ -================= -Changelog history -================= +========= +Changelog +========= Versions follow `Semantic Versioning `_ (``..``). diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html index 39cebb968..50c2239e5 100644 --- a/doc/en/_templates/globaltoc.html +++ b/doc/en/_templates/globaltoc.html @@ -4,7 +4,7 @@
  • Home
  • Install
  • Contents
  • -
  • Reference
  • +
  • API Reference
  • Examples
  • Customize
  • Changelog
  • diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 5abb01f50..afbef6b1e 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -1,5 +1,5 @@ -Reference -========= +API Reference +============= This page contains the full reference to pytest's API.