Skip to content

Commit 2498aea

Browse files
authored
Merge master into features (#5717)
Merge master into features
2 parents 8665f56 + 2f065a5 commit 2498aea

34 files changed

+620
-203
lines changed

CHANGELOG.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,27 @@ Improved Documentation
243243
- `#5416 <https://github.com/pytest-dev/pytest/issues/5416>`_: Fix PytestUnknownMarkWarning in run/skip example.
244244

245245

246+
pytest 4.6.5 (2019-08-05)
247+
=========================
248+
249+
Bug Fixes
250+
---------
251+
252+
- `#4344 <https://github.com/pytest-dev/pytest/issues/4344>`_: Fix RuntimeError/StopIteration when trying to collect package with "__init__.py" only.
253+
254+
255+
- `#5478 <https://github.com/pytest-dev/pytest/issues/5478>`_: Fix encode error when using unicode strings in exceptions with ``pytest.raises``.
256+
257+
258+
- `#5524 <https://github.com/pytest-dev/pytest/issues/5524>`_: Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
259+
which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.
260+
261+
262+
- `#5547 <https://github.com/pytest-dev/pytest/issues/5547>`_: ``--step-wise`` now handles ``xfail(strict=True)`` markers properly.
263+
264+
265+
- `#5650 <https://github.com/pytest-dev/pytest/issues/5650>`_: Improved output when parsing an ini configuration file fails.
266+
246267
pytest 4.6.4 (2019-06-28)
247268
=========================
248269

CODE_OF_CONDUCT.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
The [email protected] address is routed to the following people who can also be
69+
contacted individually:
70+
71+
- Brianna Laugher ([@pfctdayelise](https://github.com/pfctdayelise)): [email protected]
72+
- Bruno Oliveira ([@nicoddemus](https://github.com/nicoddemus)): [email protected]
73+
- Florian Bruhin ([@the-compiler](https://github.com/the-compiler)): [email protected]
74+
- Ronny Pfannschmidt ([@RonnyPfannschmidt](https://github.com/RonnyPfannschmidt)): [email protected]
75+
76+
## Attribution
77+
78+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
79+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
80+
81+
[homepage]: https://www.contributor-covenant.org
82+
83+
For answers to common questions about this code of conduct, see
84+
https://www.contributor-covenant.org/faq

doc/en/announce/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Release announcements
88

99
release-5.0.1
1010
release-5.0.0
11+
release-4.6.5
1112
release-4.6.4
1213
release-4.6.3
1314
release-4.6.2

doc/en/announce/release-4.6.5.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pytest-4.6.5
2+
=======================================
3+
4+
pytest 4.6.5 has just been released to PyPI.
5+
6+
This is a bug-fix release, being a drop-in replacement. To upgrade::
7+
8+
pip install --upgrade pytest
9+
10+
The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.
11+
12+
Thanks to all who contributed to this release, among them:
13+
14+
* Anthony Sottile
15+
* Bruno Oliveira
16+
* Daniel Hahler
17+
* Thomas Grainger
18+
19+
20+
Happy testing,
21+
The pytest Development Team

doc/en/assert.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,17 @@ file which provides an alternative explanation for ``Foo`` objects:
238238
239239
def pytest_assertrepr_compare(op, left, right):
240240
if isinstance(left, Foo) and isinstance(right, Foo) and op == "==":
241-
return ["Comparing Foo instances:", " vals: %s != %s" % (left.val, right.val)]
241+
return [
242+
"Comparing Foo instances:",
243+
" vals: {} != {}".format(left.val, right.val),
244+
]
242245
243246
now, given this test module:
244247

245248
.. code-block:: python
246249
247250
# content of test_foocompare.py
248-
class Foo(object):
251+
class Foo:
249252
def __init__(self, val):
250253
self.val = val
251254

doc/en/builtin.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
162162
163163
no tests ran in 0.12 seconds
164164
165-
You can also interactively ask for help, e.g. by typing on the Python interactive prompt something like::
165+
You can also interactively ask for help, e.g. by typing on the Python interactive prompt something like:
166+
167+
.. code-block:: python
166168
167169
import pytest
170+
168171
help(pytest)

doc/en/cache.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,18 @@ Other plugins may access the `config.cache`_ object to set/get
3333
Rerunning only failures or failures first
3434
-----------------------------------------------
3535

36-
First, let's create 50 test invocation of which only 2 fail::
36+
First, let's create 50 test invocation of which only 2 fail:
37+
38+
.. code-block:: python
3739
3840
# content of test_50.py
3941
import pytest
4042
43+
4144
@pytest.mark.parametrize("i", range(50))
4245
def test_num(i):
4346
if i in (17, 25):
44-
pytest.fail("bad luck")
47+
pytest.fail("bad luck")
4548
4649
If you run this for the first time you will see two failures:
4750

@@ -183,15 +186,19 @@ The new config.cache object
183186
Plugins or conftest.py support code can get a cached value using the
184187
pytest ``config`` object. Here is a basic example plugin which
185188
implements a :ref:`fixture` which re-uses previously created state
186-
across pytest invocations::
189+
across pytest invocations:
190+
191+
.. code-block:: python
187192
188193
# content of test_caching.py
189194
import pytest
190195
import time
191196
197+
192198
def expensive_computation():
193199
print("running expensive computation...")
194200
201+
195202
@pytest.fixture
196203
def mydata(request):
197204
val = request.config.cache.get("example/value", None)
@@ -201,6 +208,7 @@ across pytest invocations::
201208
request.config.cache.set("example/value", val)
202209
return val
203210
211+
204212
def test_function(mydata):
205213
assert mydata == 23
206214

doc/en/capture.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,21 @@ Using print statements for debugging
4949
---------------------------------------------------
5050

5151
One primary benefit of the default capturing of stdout/stderr output
52-
is that you can use print statements for debugging::
52+
is that you can use print statements for debugging:
53+
54+
.. code-block:: python
5355
5456
# content of test_module.py
5557
58+
5659
def setup_function(function):
5760
print("setting up %s" % function)
5861
62+
5963
def test_func1():
6064
assert True
6165
66+
6267
def test_func2():
6368
assert False
6469

doc/en/deprecations.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,9 @@ Internal classes accessed through ``Node``
459459
.. versionremoved:: 4.0
460460

461461
Access of ``Module``, ``Function``, ``Class``, ``Instance``, ``File`` and ``Item`` through ``Node`` instances now issue
462-
this warning::
462+
this warning:
463+
464+
.. code-block:: text
463465
464466
usage of Function.Module is deprecated, please use pytest.Module instead
465467

doc/en/doctest.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,21 @@ namespace in which your doctests run. It is intended to be used within
218218
your own fixtures to provide the tests that use them with context.
219219

220220
``doctest_namespace`` is a standard ``dict`` object into which you
221-
place the objects you want to appear in the doctest namespace::
221+
place the objects you want to appear in the doctest namespace:
222+
223+
.. code-block:: python
222224
223225
# content of conftest.py
224226
import numpy
227+
228+
225229
@pytest.fixture(autouse=True)
226230
def add_np(doctest_namespace):
227-
doctest_namespace['np'] = numpy
231+
doctest_namespace["np"] = numpy
228232
229-
which can then be used in your doctests directly::
233+
which can then be used in your doctests directly:
234+
235+
.. code-block:: python
230236
231237
# content of numpy.py
232238
def arange():
@@ -246,7 +252,9 @@ Skipping tests dynamically
246252

247253
.. versionadded:: 4.4
248254

249-
You can use ``pytest.skip`` to dynamically skip doctests. For example::
255+
You can use ``pytest.skip`` to dynamically skip doctests. For example:
256+
257+
.. code-block:: text
250258
251259
>>> import sys, pytest
252260
>>> if sys.platform.startswith('win'):

0 commit comments

Comments
 (0)