Skip to content

Commit 2534193

Browse files
authored
Merge pull request #3738 from nicoddemus/release-3.7.0
Release 3.7.0
2 parents 9f5d73d + 997ef59 commit 2534193

25 files changed

+195
-38
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jobs:
4141
- env: TOXENV=py36-freeze
4242
python: '3.6'
4343
- env: TOXENV=py37
44-
python: 'nightly'
44+
python: '3.7'
45+
sudo: required
46+
dist: xenial
4547

4648
- stage: deploy
4749
python: '3.6'

CHANGELOG.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,70 @@
88
99
.. towncrier release notes start
1010
11+
pytest 3.7.0 (2018-07-30)
12+
=========================
13+
14+
Deprecations and Removals
15+
-------------------------
16+
17+
- `#2639 <https://github.com/pytest-dev/pytest/issues/2639>`_: ``pytest_namespace`` has been deprecated.
18+
19+
See the documentation for ``pytest_namespace`` hook for suggestions on how to deal
20+
with this in plugins which use this functionality.
21+
22+
23+
- `#3661 <https://github.com/pytest-dev/pytest/issues/3661>`_: Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. It will be changed into an error in pytest ``4.0``.
24+
25+
This is a great source of confusion to new users, which will often call the fixture functions and request them from test functions interchangeably, which breaks the fixture resolution model.
26+
27+
28+
29+
Features
30+
--------
31+
32+
- `#2283 <https://github.com/pytest-dev/pytest/issues/2283>`_: New ``package`` fixture scope: fixtures are finalized when the last test of a *package* finishes. This feature is considered **experimental**, so use it sparingly.
33+
34+
35+
- `#3576 <https://github.com/pytest-dev/pytest/issues/3576>`_: ``Node.add_marker`` now supports an ``append=True/False`` parameter to determine whether the mark comes last (default) or first.
36+
37+
38+
- `#3579 <https://github.com/pytest-dev/pytest/issues/3579>`_: Fixture ``caplog`` now has a ``messages`` property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler.
39+
40+
41+
- `#3610 <https://github.com/pytest-dev/pytest/issues/3610>`_: New ``--trace`` option to enter the debugger at the start of a test.
42+
43+
44+
- `#3623 <https://github.com/pytest-dev/pytest/issues/3623>`_: Introduce ``pytester.copy_example`` as helper to do acceptance tests against examples from the project.
45+
46+
47+
48+
Bug Fixes
49+
---------
50+
51+
- `#2220 <https://github.com/pytest-dev/pytest/issues/2220>`_: Fix a bug where fixtures overridden by direct parameters (for example parametrization) were being instantiated even if they were not being used by a test.
52+
53+
54+
- `#3695 <https://github.com/pytest-dev/pytest/issues/3695>`_: Fix ``ApproxNumpy`` initialisation argument mixup, ``abs`` and ``rel`` tolerances were flipped causing strange comparsion results.
55+
Add tests to check ``abs`` and ``rel`` tolerances for ``np.array`` and test for expecting ``nan`` with ``np.array()``
56+
57+
58+
- `#980 <https://github.com/pytest-dev/pytest/issues/980>`_: Fix truncated locals output in verbose mode.
59+
60+
61+
62+
Improved Documentation
63+
----------------------
64+
65+
- `#3295 <https://github.com/pytest-dev/pytest/issues/3295>`_: Correct the usage documentation of ``--last-failed-no-failures`` by adding the missing ``--last-failed`` argument in the presented examples, because they are misleading and lead to think that the missing argument is not needed.
66+
67+
68+
69+
Trivial/Internal Changes
70+
------------------------
71+
72+
- `#3519 <https://github.com/pytest-dev/pytest/issues/3519>`_: Now a ``README.md`` file is created in ``.pytest_cache`` to make it clear why the directory exists.
73+
74+
1175
pytest 3.6.4 (2018-07-28)
1276
=========================
1377

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ environment:
1414
- TOXENV: "py34"
1515
- TOXENV: "py35"
1616
- TOXENV: "py36"
17+
- TOXENV: "py37"
1718
# - TOXENV: "pypy" reenable when we are able to provide a scandir wheel or build scandir
1819
- TOXENV: "py27-pexpect"
1920
- TOXENV: "py27-xdist"

changelog/2220.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2283.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2639.removal.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

changelog/3519.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3576.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3579.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3610.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3623.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3661.removal.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

changelog/980.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/en/announce/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-3.7.0
910
release-3.6.4
1011
release-3.6.3
1112
release-3.6.2

doc/en/announce/release-3.7.0.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
pytest-3.7.0
2+
=======================================
3+
4+
The pytest team is proud to announce the 3.7.0 release!
5+
6+
pytest is a mature Python testing tool with more than a 2000 tests
7+
against itself, passing on many different interpreters and platforms.
8+
9+
This release contains a number of bugs fixes and improvements, so users are encouraged
10+
to take a look at the CHANGELOG:
11+
12+
http://doc.pytest.org/en/latest/changelog.html
13+
14+
For complete documentation, please visit:
15+
16+
http://docs.pytest.org
17+
18+
As usual, you can upgrade from pypi via:
19+
20+
pip install -U pytest
21+
22+
Thanks to all who contributed to this release, among them:
23+
24+
* Alan
25+
* Alan Brammer
26+
* Ammar Najjar
27+
* Anthony Sottile
28+
* Bruno Oliveira
29+
* Jeffrey Rackauckas
30+
* Kale Kundert
31+
* Ronny Pfannschmidt
32+
* Serhii Mozghovyi
33+
* Tadek Teleżyński
34+
* Wil Cooley
35+
* abrammer
36+
* avirlrma
37+
* turturica
38+
39+
40+
Happy testing,
41+
The Pytest Development Team

doc/en/cache.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ When no tests failed in the last run, or when no cached ``lastfailed`` data was
162162
found, ``pytest`` can be configured either to run all of the tests or no tests,
163163
using the ``--last-failed-no-failures`` option, which takes one of the following values::
164164

165-
pytest --last-failed-no-failures all # run all tests (default behavior)
166-
pytest --last-failed-no-failures none # run no tests and exit
165+
pytest --last-failed --last-failed-no-failures all # run all tests (default behavior)
166+
pytest --last-failed --last-failed-no-failures none # run no tests and exit
167167

168168
The new config.cache object
169169
--------------------------------

doc/en/example/markers.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can then restrict a test run to only run tests marked with ``webtest``::
3131

3232
$ pytest -v -m webtest
3333
=========================== test session starts ============================
34-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
34+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
3535
cachedir: .pytest_cache
3636
rootdir: $REGENDOC_TMPDIR, inifile:
3737
collecting ... collected 4 items / 3 deselected
@@ -44,7 +44,7 @@ Or the inverse, running all tests except the webtest ones::
4444

4545
$ pytest -v -m "not webtest"
4646
=========================== test session starts ============================
47-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
47+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
4848
cachedir: .pytest_cache
4949
rootdir: $REGENDOC_TMPDIR, inifile:
5050
collecting ... collected 4 items / 1 deselected
@@ -64,7 +64,7 @@ tests based on their module, class, method, or function name::
6464

6565
$ pytest -v test_server.py::TestClass::test_method
6666
=========================== test session starts ============================
67-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
67+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
6868
cachedir: .pytest_cache
6969
rootdir: $REGENDOC_TMPDIR, inifile:
7070
collecting ... collected 1 item
@@ -77,7 +77,7 @@ You can also select on the class::
7777

7878
$ pytest -v test_server.py::TestClass
7979
=========================== test session starts ============================
80-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
80+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
8181
cachedir: .pytest_cache
8282
rootdir: $REGENDOC_TMPDIR, inifile:
8383
collecting ... collected 1 item
@@ -90,7 +90,7 @@ Or select multiple nodes::
9090

9191
$ pytest -v test_server.py::TestClass test_server.py::test_send_http
9292
=========================== test session starts ============================
93-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
93+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
9494
cachedir: .pytest_cache
9595
rootdir: $REGENDOC_TMPDIR, inifile:
9696
collecting ... collected 2 items
@@ -128,7 +128,7 @@ select tests based on their names::
128128

129129
$ pytest -v -k http # running with the above defined example module
130130
=========================== test session starts ============================
131-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
131+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
132132
cachedir: .pytest_cache
133133
rootdir: $REGENDOC_TMPDIR, inifile:
134134
collecting ... collected 4 items / 3 deselected
@@ -141,7 +141,7 @@ And you can also run all tests except the ones that match the keyword::
141141

142142
$ pytest -k "not send_http" -v
143143
=========================== test session starts ============================
144-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
144+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
145145
cachedir: .pytest_cache
146146
rootdir: $REGENDOC_TMPDIR, inifile:
147147
collecting ... collected 4 items / 1 deselected
@@ -156,7 +156,7 @@ Or to select "http" and "quick" tests::
156156

157157
$ pytest -k "http or quick" -v
158158
=========================== test session starts ============================
159-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
159+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
160160
cachedir: .pytest_cache
161161
rootdir: $REGENDOC_TMPDIR, inifile:
162162
collecting ... collected 4 items / 2 deselected

doc/en/example/nonpython.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ consulted when reporting in ``verbose`` mode::
5959

6060
nonpython $ pytest -v
6161
=========================== test session starts ============================
62-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
62+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
6363
cachedir: .pytest_cache
6464
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
6565
collecting ... collected 2 items
@@ -84,8 +84,9 @@ interesting to just look at the collection tree::
8484
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
8585
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
8686
collected 2 items
87-
<YamlFile 'test_simple.yml'>
88-
<YamlItem 'hello'>
89-
<YamlItem 'ok'>
87+
<Package '$REGENDOC_TMPDIR/nonpython'>
88+
<YamlFile 'test_simple.yml'>
89+
<YamlItem 'hello'>
90+
<YamlItem 'ok'>
9091

9192
======================= no tests ran in 0.12 seconds =======================

doc/en/example/reportingdemo.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ get on the terminal - we are working on that)::
363363
> int(s)
364364
E ValueError: invalid literal for int() with base 10: 'qwe'
365365

366-
<0-codegen $PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/python_api.py:635>:1: ValueError
366+
<0-codegen $PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/python_api.py:635>:1: ValueError
367367
______________________ TestRaises.test_raises_doesnt _______________________
368368

369369
self = <failure_demo.TestRaises object at 0xdeadbeef>

doc/en/example/simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ which will add info only when run with "--v"::
357357

358358
$ pytest -v
359359
=========================== test session starts ============================
360-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
360+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
361361
cachedir: .pytest_cache
362362
info1: did you know that ...
363363
did you?

doc/en/fixture.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ Running this test will *skip* the invocation of ``data_set`` with value ``2``::
726726

727727
$ pytest test_fixture_marks.py -v
728728
=========================== test session starts ============================
729-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
729+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
730730
cachedir: .pytest_cache
731731
rootdir: $REGENDOC_TMPDIR, inifile:
732732
collecting ... collected 3 items
@@ -769,7 +769,7 @@ Here we declare an ``app`` fixture which receives the previously defined
769769

770770
$ pytest -v test_appsetup.py
771771
=========================== test session starts ============================
772-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
772+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
773773
cachedir: .pytest_cache
774774
rootdir: $REGENDOC_TMPDIR, inifile:
775775
collecting ... collected 2 items
@@ -838,7 +838,7 @@ Let's run the tests in verbose mode and with looking at the print-output::
838838

839839
$ pytest -v -s test_module.py
840840
=========================== test session starts ============================
841-
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
841+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6
842842
cachedir: .pytest_cache
843843
rootdir: $REGENDOC_TMPDIR, inifile:
844844
collecting ... collected 8 items

doc/en/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Install ``pytest``
2727
2. Check that you installed the correct version::
2828

2929
$ pytest --version
30-
This is pytest version 3.x.y, imported from $PYTHON_PREFIX/lib/python3.5/site-packages/pytest.py
30+
This is pytest version 3.x.y, imported from $PYTHON_PREFIX/lib/python3.6/site-packages/pytest.py
3131

3232
.. _`simpletest`:
3333

src/_pytest/python_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def __eq__(self, actual):
211211
the pre-specified tolerance.
212212
"""
213213
if _is_numpy_array(actual):
214-
return ApproxNumpy(actual, self.abs, self.rel, self.nan_ok) == self.expected
214+
return all(a == self for a in actual.flat)
215215

216216
# Short-circuit exact equality.
217217
if actual == self.expected:

0 commit comments

Comments
 (0)