Skip to content

Commit 28343bd

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6e687c4 + 7fa2748 commit 28343bd

32 files changed

+283
-111
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ repos:
55
hooks:
66
- id: black
77
args: [--safe, --quiet]
8-
language_version: python3
98
- repo: https://github.com/asottile/blacken-docs
109
rev: v1.0.0
1110
hooks:
1211
- id: blacken-docs
1312
additional_dependencies: [black==19.3b0]
14-
language_version: python3
1513
- repo: https://github.com/pre-commit/pre-commit-hooks
1614
rev: v2.2.3
1715
hooks:

CHANGELOG.rst

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=================
2-
Changelog history
3-
=================
1+
=========
2+
Changelog
3+
=========
44

55
Versions follow `Semantic Versioning <https://semver.org/>`_ (``<major>.<minor>.<patch>``).
66

@@ -90,6 +90,24 @@ Removals
9090
- `#5412 <https://github.com/pytest-dev/pytest/issues/5412>`_: ``ExceptionInfo`` objects (returned by ``pytest.raises``) now have the same ``str`` representation as ``repr``, which
9191
avoids some confusion when users use ``print(e)`` to inspect the object.
9292

93+
This means code like:
94+
95+
.. code-block:: python
96+
97+
with pytest.raises(SomeException) as e:
98+
...
99+
assert "some message" in str(e)
100+
101+
102+
Needs to be changed to:
103+
104+
.. code-block:: python
105+
106+
with pytest.raises(SomeException) as e:
107+
...
108+
assert "some message" in str(e.value)
109+
110+
93111
94112
95113
Deprecations
@@ -2173,10 +2191,10 @@ Features
21732191
design. This introduces new ``Node.iter_markers(name)`` and
21742192
``Node.get_closest_marker(name)`` APIs. Users are **strongly encouraged** to
21752193
read the `reasons for the revamp in the docs
2176-
<https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration>`_,
2194+
<https://docs.pytest.org/en/latest/historical-notes.html#marker-revamp-and-iteration>`_,
21772195
or jump over to details about `updating existing code to use the new APIs
2178-
<https://docs.pytest.org/en/latest/mark.html#updating-code>`_. (`#3317
2179-
<https://github.com/pytest-dev/pytest/issues/3317>`_)
2196+
<https://docs.pytest.org/en/latest/historical-notes.html#updating-code>`_.
2197+
(`#3317 <https://github.com/pytest-dev/pytest/issues/3317>`_)
21802198

21812199
- Now when ``@pytest.fixture`` is applied more than once to the same function a
21822200
``ValueError`` is raised. This buggy behavior would cause surprising problems
@@ -2582,10 +2600,10 @@ Features
25822600
<https://github.com/pytest-dev/pytest/issues/3038>`_)
25832601

25842602
- New `pytest_runtest_logfinish
2585-
<https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_logfinish>`_
2603+
<https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_runtest_logfinish>`_
25862604
hook which is called when a test item has finished executing, analogous to
25872605
`pytest_runtest_logstart
2588-
<https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_start>`_.
2606+
<https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_runtest_logstart>`_.
25892607
(`#3101 <https://github.com/pytest-dev/pytest/issues/3101>`_)
25902608

25912609
- Improve performance when collecting tests using many fixtures. (`#3107
@@ -3575,7 +3593,7 @@ Bug Fixes
35753593
Thanks `@sirex`_ for the report and `@nicoddemus`_ for the PR.
35763594

35773595
* Replace ``raise StopIteration`` usages in the code by simple ``returns`` to finish generators, in accordance to `PEP-479`_ (`#2160`_).
3578-
Thanks `@tgoodlet`_ for the report and `@nicoddemus`_ for the PR.
3596+
Thanks to `@nicoddemus`_ for the PR.
35793597

35803598
* Fix internal errors when an unprintable ``AssertionError`` is raised inside a test.
35813599
Thanks `@omerhadari`_ for the PR.
@@ -3706,7 +3724,7 @@ Bug Fixes
37063724

37073725
.. _@syre: https://github.com/syre
37083726
.. _@adler-j: https://github.com/adler-j
3709-
.. _@d-b-w: https://bitbucket.org/d-b-w/
3727+
.. _@d-b-w: https://github.com/d-b-w
37103728
.. _@DuncanBetts: https://github.com/DuncanBetts
37113729
.. _@dupuy: https://bitbucket.org/dupuy/
37123730
.. _@kerrick-lyft: https://github.com/kerrick-lyft
@@ -3766,7 +3784,7 @@ Bug Fixes
37663784

37673785
.. _@adborden: https://github.com/adborden
37683786
.. _@cwitty: https://github.com/cwitty
3769-
.. _@d_b_w: https://github.com/d_b_w
3787+
.. _@d_b_w: https://github.com/d-b-w
37703788
.. _@gdyuldin: https://github.com/gdyuldin
37713789
.. _@matclab: https://github.com/matclab
37723790
.. _@MSeifert04: https://github.com/MSeifert04
@@ -3801,7 +3819,7 @@ Bug Fixes
38013819
Thanks `@axil`_ for the PR.
38023820

38033821
* Explain a bad scope value passed to ``@fixture`` declarations or
3804-
a ``MetaFunc.parametrize()`` call. Thanks `@tgoodlet`_ for the PR.
3822+
a ``MetaFunc.parametrize()`` call.
38053823

38063824
* This version includes ``pluggy-0.4.0``, which correctly handles
38073825
``VersionConflict`` errors in plugins (`#704`_).
@@ -3811,7 +3829,6 @@ Bug Fixes
38113829
.. _@philpep: https://github.com/philpep
38123830
.. _@raquel-ucl: https://github.com/raquel-ucl
38133831
.. _@axil: https://github.com/axil
3814-
.. _@tgoodlet: https://github.com/tgoodlet
38153832
.. _@vlad-dragos: https://github.com/vlad-dragos
38163833

38173834
.. _#1853: https://github.com/pytest-dev/pytest/issues/1853
@@ -4157,7 +4174,7 @@ time or change existing behaviors in order to make them less surprising/more use
41574174
* Updated docstrings with a more uniform style.
41584175

41594176
* Add stderr write for ``pytest.exit(msg)`` during startup. Previously the message was never shown.
4160-
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@JonathonSonesen`_ and
4177+
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@jgsonesen`_ and
41614178
`@tomviner`_ for the PR.
41624179

41634180
* No longer display the incorrect test deselection reason (`#1372`_).
@@ -4205,7 +4222,7 @@ time or change existing behaviors in order to make them less surprising/more use
42054222
Thanks to `@Stranger6667`_ for the PR.
42064223

42074224
* Fixed the total tests tally in junit xml output (`#1798`_).
4208-
Thanks to `@cryporchild`_ for the PR.
4225+
Thanks to `@cboelsen`_ for the PR.
42094226

42104227
* Fixed off-by-one error with lines from ``request.node.warn``.
42114228
Thanks to `@blueyed`_ for the PR.
@@ -4278,7 +4295,7 @@ time or change existing behaviors in order to make them less surprising/more use
42784295
.. _@BeyondEvil: https://github.com/BeyondEvil
42794296
.. _@blueyed: https://github.com/blueyed
42804297
.. _@ceridwen: https://github.com/ceridwen
4281-
.. _@cryporchild: https://github.com/cryporchild
4298+
.. _@cboelsen: https://github.com/cboelsen
42824299
.. _@csaftoiu: https://github.com/csaftoiu
42834300
.. _@d6e: https://github.com/d6e
42844301
.. _@davehunt: https://github.com/davehunt
@@ -4289,7 +4306,7 @@ time or change existing behaviors in order to make them less surprising/more use
42894306
.. _@gprasad84: https://github.com/gprasad84
42904307
.. _@graingert: https://github.com/graingert
42914308
.. _@hartym: https://github.com/hartym
4292-
.. _@JonathonSonesen: https://github.com/JonathonSonesen
4309+
.. _@jgsonesen: https://github.com/jgsonesen
42934310
.. _@kalekundert: https://github.com/kalekundert
42944311
.. _@kvas-it: https://github.com/kvas-it
42954312
.. _@marscher: https://github.com/marscher
@@ -4426,7 +4443,7 @@ time or change existing behaviors in order to make them less surprising/more use
44264443

44274444
**Changes**
44284445

4429-
* **Important**: `py.code <https://pylib.readthedocs.io/en/latest/code.html>`_ has been
4446+
* **Important**: `py.code <https://pylib.readthedocs.io/en/stable/code.html>`_ has been
44304447
merged into the ``pytest`` repository as ``pytest._code``. This decision
44314448
was made because ``py.code`` had very few uses outside ``pytest`` and the
44324449
fact that it was in a different repository made it difficult to fix bugs on

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ Consult the `Changelog <https://docs.pytest.org/en/latest/changelog.html>`__ pag
111111
Support pytest
112112
--------------
113113

114-
You can support pytest by obtaining a `Tideflift subscription`_.
114+
You can support pytest by obtaining a `Tidelift subscription`_.
115115

116116
Tidelift gives software development teams a single source for purchasing and maintaining their software,
117117
with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.
118118

119119

120-
.. _`Tideflift subscription`: https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=readme
120+
.. _`Tidelift subscription`: https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=readme
121121

122122

123123
Security

changelog/5606.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed internal error when test functions were patched with objects that cannot be compared
2+
for truth values against others, like ``numpy`` arrays.

changelog/5634.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``pytest.exit`` is now correctly handled in ``unittest`` cases.
2+
This makes ``unittest`` cases handle ``quit`` from pytest's pdb correctly.

changelog/5650.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improved output when parsing an ini configuration file fails.

doc/en/_templates/globaltoc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
44
<li><a href="{{ pathto('index') }}">Home</a></li>
55
<li><a href="{{ pathto('getting-started') }}">Install</a></li>
66
<li><a href="{{ pathto('contents') }}">Contents</a></li>
7-
<li><a href="{{ pathto('reference') }}">Reference</a></li>
7+
<li><a href="{{ pathto('reference') }}">API Reference</a></li>
88
<li><a href="{{ pathto('example/index') }}">Examples</a></li>
99
<li><a href="{{ pathto('customize') }}">Customize</a></li>
1010
<li><a href="{{ pathto('changelog') }}">Changelog</a></li>

doc/en/_themes/flask/static/flasky.css_t

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,56 @@ a:hover tt {
424424
background: #EEE;
425425
}
426426

427+
#reference div.section h2 {
428+
/* separate code elements in the reference section */
429+
border-top: 2px solid #ccc;
430+
padding-top: 0.5em;
431+
}
432+
427433
#reference div.section h3 {
428434
/* separate code elements in the reference section */
429435
border-top: 1px solid #ccc;
430436
padding-top: 0.5em;
431437
}
432438

439+
dl.class, dl.function {
440+
margin-top: 1em;
441+
margin-bottom: 1em;
442+
}
443+
444+
dl.class > dd {
445+
border-left: 3px solid #ccc;
446+
margin-left: 0px;
447+
padding-left: 30px;
448+
}
449+
450+
dl.field-list {
451+
flex-direction: column;
452+
}
453+
454+
dl.field-list dd {
455+
padding-left: 4em;
456+
border-left: 3px solid #ccc;
457+
margin-bottom: 0.5em;
458+
}
459+
460+
dl.field-list dd > ul {
461+
list-style: none;
462+
padding-left: 0px;
463+
}
464+
465+
dl.field-list dd > ul > li li :first-child {
466+
text-indent: 0;
467+
}
468+
469+
dl.field-list dd > ul > li :first-child {
470+
text-indent: -2em;
471+
padding-left: 0px;
472+
}
473+
474+
dl.field-list dd > p:first-child {
475+
text-indent: -2em;
476+
}
433477

434478
@media screen and (max-width: 870px) {
435479

doc/en/adopt.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ The ideal pytest helper
2424
- feels confident in using pytest (e.g. has explored command line options, knows how to write parametrized tests, has an idea about conftest contents)
2525
- does not need to be an expert in every aspect!
2626

27-
`Pytest helpers, sign up here`_! (preferably in February, hard deadline 22 March)
27+
Pytest helpers, sign up here! (preferably in February, hard deadline 22 March)
2828

2929

30-
.. _`Pytest helpers, sign up here`: http://goo.gl/forms/nxqAhqWt1P
31-
3230

3331
The ideal partner project
3432
-----------------------------------------
@@ -40,10 +38,8 @@ The ideal partner project
4038
- has the support of the core development team, in trying out pytest adoption
4139
- has no tests... or 100% test coverage... or somewhere in between!
4240

43-
`Partner projects, sign up here`_! (by 22 March)
44-
41+
Partner projects, sign up here! (by 22 March)
4542

46-
.. _`Partner projects, sign up here`: http://goo.gl/forms/ZGyqlHiwk3
4743

4844

4945
What does it mean to "adopt pytest"?
@@ -68,11 +64,11 @@ Progressive success might look like:
6864
It may be after the month is up, the partner project decides that pytest is not right for it. That's okay - hopefully the pytest team will also learn something about its weaknesses or deficiencies.
6965

7066
.. _`nose and unittest`: faq.html#how-does-pytest-relate-to-nose-and-unittest
71-
.. _assert: asserts.html
67+
.. _assert: assert.html
7268
.. _pycmd: https://bitbucket.org/hpk42/pycmd/overview
7369
.. _`setUp/tearDown methods`: xunit_setup.html
7470
.. _fixtures: fixture.html
75-
.. _markers: markers.html
71+
.. _markers: mark.html
7672
.. _distributed: xdist.html
7773

7874

doc/en/announce/release-2.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ courtesy of Benjamin Peterson. You can now safely use ``assert``
1212
statements in test modules without having to worry about side effects
1313
or python optimization ("-OO") options. This is achieved by rewriting
1414
assert statements in test modules upon import, using a PEP302 hook.
15-
See http://pytest.org/assert.html#advanced-assertion-introspection for
15+
See https://docs.pytest.org/en/latest/assert.html for
1616
detailed information. The work has been partly sponsored by my company,
1717
merlinux GmbH.
1818

0 commit comments

Comments
 (0)