Skip to content

Commit aeccd6b

Browse files
authored
Merge pull request #1720 from nicoddemus/changelog-formatting
Improve overall CHANGELOG formatting and consistency for 3.0
2 parents 54ea27c + 4a763ac commit aeccd6b

File tree

1 file changed

+85
-77
lines changed

1 file changed

+85
-77
lines changed

CHANGELOG.rst

Lines changed: 85 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,46 @@
33

44
**Incompatible changes**
55

6-
* Removed the following deprecated commandline options
6+
A number of incompatible changes were made in this release, with the intent of removing features deprecated for a long
7+
time or change existing behaviors in order to make them less surprising/more useful.
78

8-
* ``--genscript``
9-
* ``--no-assert``
10-
* ``--nomagic``
11-
* ``--report``
9+
* The following deprecated commandline options were removed:
1210

13-
Thanks to `@RedBeardCode`_ for the PR (`#1664`_)
11+
* ``--genscript``: no longer supported;
12+
* ``--no-assert``: use ``--assert=plain`` instead;
13+
* ``--nomagic``: use ``--assert=plain`` instead;
14+
* ``--report``: use ``-r`` instead;
15+
16+
Thanks to `@RedBeardCode`_ for the PR (`#1664`_).
1417

1518
* ImportErrors in plugins now are a fatal error instead of issuing a
1619
pytest warning (`#1479`_). Thanks to `@The-Compiler`_ for the PR.
1720

18-
* removed support code for python 3 < 3.3 addressing (`#1627`_)
21+
* Removed support code for Python 3 versions < 3.3 (`#1627`_).
1922

20-
* Remove all py.test-X* entry points. The versioned, suffixed entry points
23+
* Removed all ``py.test-X*`` entry points. The versioned, suffixed entry points
2124
were never documented and a leftover from a pre-virtualenv era. These entry
2225
points also created broken entry points in wheels, so removing them also
2326
removes a source of confusion for users (`#1632`_).
2427
Thanks `@obestwalter`_ for the PR.
2528

26-
* Fix `#607`_: pytest.skip() is no longer allowed at module level to
27-
prevent misleading use as test function decorator. When used at a module
28-
level an error will be raised during collection.
29+
* ``pytest.skip()`` now raises an error when used to decorate a test function,
30+
as opposed to its original intent (to imperatively skip a test inside a test function). Previously
31+
this usage would cause the entire module to be skipped (`#607`_).
2932
Thanks `@omarkohl`_ for the complete PR (`#1519`_).
3033

31-
* Fix `#1421`_: Exit tests if a collection error occurs and add
32-
``--continue-on-collection-errors`` option to restore previous behaviour.
34+
* Exit tests if a collection error occurs. A poll indicated most users will hit CTRL-C
35+
anyway as soon as they see collection errors, so pytest might as well make that the default behavior (`#1421`_).
36+
A ``--continue-on-collection-errors`` option has been added to restore the previous behaviour.
3337
Thanks `@olegpidsadnyi`_ and `@omarkohl`_ for the complete PR (`#1628`_).
3438

35-
* Renamed the pytest ``pdb`` module (plugin) into ``debugging``.
39+
* Renamed the pytest ``pdb`` module (plugin) into ``debugging`` to avoid clashes with the builtin ``pdb`` module.
3640

37-
* Raise helpful failure message, when requesting parametrized fixture at runtime,
38-
e.g. with ``request.getfuncargvalue``. Previously these params were simply
39-
never defined. So a fixture decorated like ``@pytest.fixture(params=[0, 1,
40-
2])`` only ran once. Now a failure is raised. Fixes `#460`_. Thanks to
41-
`@nikratio`_ for bug report, `@RedBeardCode`_ and `@tomviner`_ for PR.
41+
* Raise a helpful failure message when requesting a parametrized fixture at runtime,
42+
e.g. with ``request.getfixturevalue``. Previously these parameters were simply
43+
never defined, so a fixture decorated like ``@pytest.fixture(params=[0, 1, 2])``
44+
only ran once (`#460`_).
45+
Thanks to `@nikratio`_ for the bug report, `@RedBeardCode`_ and `@tomviner`_ for the PR.
4246

4347
* ``_pytest.monkeypatch.monkeypatch`` class has been renamed to ``_pytest.monkeypatch.MonkeyPatch``
4448
so it doesn't conflict with the ``monkeypatch`` fixture.
@@ -54,71 +58,80 @@
5458
**New Features**
5559

5660
* Support nose-style ``__test__`` attribute on methods of classes,
57-
including unittest-style Classes. If set to False, the test will not be
61+
including unittest-style Classes. If set to ``False``, the test will not be
5862
collected.
5963

6064
* New ``doctest_namespace`` fixture for injecting names into the
61-
namespace in which your doctests run.
65+
namespace in which doctests run.
6266
Thanks `@milliams`_ for the complete PR (`#1428`_).
6367

64-
* New ``name`` argument to ``pytest.fixture`` mark, which allows a custom name
68+
* New ``name`` argument to ``pytest.fixture`` decorator which allows a custom name
6569
for a fixture (to solve the funcarg-shadowing-fixture problem).
6670
Thanks `@novas0x2a`_ for the complete PR (`#1444`_).
6771

6872
* New ``approx()`` function for easily comparing floating-point numbers in
6973
tests.
7074
Thanks `@kalekundert`_ for the complete PR (`#1441`_).
7175

72-
* New Add ability to add global properties in the final xunit output file.
76+
* Ability to add global properties in the final xunit output file by accessing
77+
the internal ``junitxml`` plugin (experimental).
7378
Thanks `@tareqalayan`_ for the complete PR `#1454`_).
7479

7580
* New ``ExceptionInfo.match()`` method to match a regular expression on the
76-
string representation of an exception. Closes proposal `#372`_.
77-
Thanks `@omarkohl`_ for the complete PR (`#1502`_) and `@nicoddemus`_ for the
78-
implementation tips.
81+
string representation of an exception (`#372`_).
82+
Thanks `@omarkohl`_ for the complete PR (`#1502`_).
7983

8084
* ``__tracebackhide__`` can now also be set to a callable which then can decide
8185
whether to filter the traceback based on the ``ExceptionInfo`` object passed
8286
to it. Thanks `@The-Compiler`_ for the complete PR (`#1526`_).
8387

84-
* New ``pytest_make_parametrize_id`` hook.
88+
* New ``pytest_make_parametrize_id(config, val)`` hook which can be used by plugins to provide
89+
friendly strings for custom types.
8590
Thanks `@palaviv`_ for the PR.
8691

87-
* ``capsys`` and ``capfd`` now have a ``disabled()`` method, which is a context manager
88-
that can be used to temporarily disable capture within a test.
92+
* ``capsys`` and ``capfd`` now have a ``disabled()`` context-manager method, which
93+
can be used to temporarily disable capture within a test.
8994
Thanks `@nicoddemus`_ for the PR.
9095

91-
* New cli flag ``--fixtures-per-test`` that shows which fixtures are being used
96+
* New cli flag ``--fixtures-per-test``: shows which fixtures are being used
9297
for each selected test item. Features doc strings of fixtures by default.
9398
Can also show where fixtures are defined if combined with ``-v``.
9499
Thanks `@hackebrot`_ for the PR.
95100

96-
* Introduce pytest command as recommended entry point. Closes proposal
101+
* Introduce ``pytest`` command as recommended entry point. Note that ``py.test``
102+
still works and is not scheduled for removal. Closes proposal
97103
`#1629`_. Thanks `@obestwalter`_ and `@davehunt`_ for the complete PR
98-
(`#1633`_)
104+
(`#1633`_).
105+
106+
* New cli flags:
107+
108+
+ ``--setup-plan``: performs normal collection and reports
109+
the potential setup and teardown and does not execute any fixtures and tests;
110+
+ ``--setup-only``: performs normal collection, executes setup and teardown of
111+
fixtures and reports them;
112+
+ ``--setup-show``: performs normal test execution and additionally shows
113+
setup and teardown of fixtures;
99114

100-
* New cli flags: (1) ``--setup-plan`` performs normal collection and reports
101-
the potential setup and teardown, does not execute any fixtures and tests (2)
102-
``--setup-only`` performs normal collection, executes setup and teardown of
103-
fixtures and reports them. (3) ``--setup-show`` performs normal test
104-
execution and additionally shows the setup and teardown of fixtures.
105115
Thanks `@d6e`_, `@kvas-it`_, `@sallner`_ and `@omarkohl`_ for the PRs.
106116

107-
* Added two new hooks: ``pytest_fixture_setup`` which executes the fixture
108-
setup and ``pytest_fixture_post_finalizer`` which is called after the fixture's
109-
finalizer and has access to the fixture's result cache.
110-
Thanks `@d6e`_, `@sallner`_
117+
* New cli flag ``--override-ini``/``-o``: overrides values from the ini file.
118+
For example: ``"-o xfail_strict=True"``'.
119+
Thanks `@blueyed`_ and `@fengxx`_ for the PR.
120+
121+
* New hooks:
122+
123+
+ ``pytest_fixture_setup(fixturedef, request)``: executes fixture setup;
124+
+ ``pytest_fixture_post_finalizer(fixturedef)``: called after the fixture's
125+
finalizer and has access to the fixture's result cache.
126+
127+
Thanks `@d6e`_, `@sallner`_.
111128

112-
* Issue a warning for asserts whose test is a tuple literal. Such asserts will
129+
* Issue warnings for asserts whose test is a tuple literal. Such asserts will
113130
never fail because tuples are always truthy and are usually a mistake
114131
(see `#1562`_). Thanks `@kvas-it`_, for the PR.
115132

116-
* New cli flag ``--override-ini`` or ``-o`` that overrides values from the ini file.
117-
Example '-o xfail_strict=True'. A complete ini-options can be viewed
118-
by py.test --help. Thanks `@blueyed`_ and `@fengxx`_ for the PR
119-
120-
* Allow passing a custom debugger class (e.g. ``IPython.core.debugger:Pdb``
121-
via ``--pdbcls``). Thanks to `@anntzer`_ for the PR.
133+
* Allow passing a custom debugger class (e.g. ``--pdbcls=IPython.core.debugger:Pdb``).
134+
Thanks to `@anntzer`_ for the PR.
122135

123136
*
124137

@@ -136,27 +149,26 @@
136149
the preferred way to write teardown code (`#1461`_).
137150
Thanks `@csaftoiu`_ for bringing this to attention and `@nicoddemus`_ for the PR.
138151

139-
* Fix `#1351`_:
140-
explicitly passed parametrize ids do not get escaped to ascii.
152+
* Explicitly passed parametrize ids do not get escaped to ascii (`#1351`_).
141153
Thanks `@ceridwen`_ for the PR.
142154

143-
* parametrize ids can accept None as specific test id. The
155+
* Parametrize ids can accept ``None`` as specific test id, in which case the
144156
automatically generated id for that argument will be used.
145157
Thanks `@palaviv`_ for the complete PR (`#1468`_).
146158

147-
* improved idmaker name selection in case of duplicate ids in
159+
* Improved automatic id generation selection in case of duplicate ids in
148160
parametrize.
149161
Thanks `@palaviv`_ for the complete PR (`#1474`_).
150162

151-
* Fix `#1426`_ Make ImportError during collection more explicit by reminding
152-
the user to check the name of the test module/package(s).
163+
* Make ImportError during collection more explicit by reminding
164+
the user to check the name of the test module/package(s) (`#1426`_).
153165
Thanks `@omarkohl`_ for the complete PR (`#1520`_).
154166

155167
* Add ``build/`` and ``dist/`` to the default ``--norecursedirs`` list. Thanks
156168
`@mikofski`_ for the report and `@tomviner`_ for the PR (`#1544`_).
157169

158-
* pytest.raises in the context manager form accepts a custom
159-
message to raise when no exception occurred.
170+
* ``pytest.raises`` in the context manager form accepts a custom
171+
``message`` to raise when no exception occurred.
160172
Thanks `@palaviv`_ for the complete PR (`#1616`_).
161173

162174
* ``conftest.py`` files now benefit from assertion rewriting; previously it
@@ -170,17 +182,10 @@
170182
is specified on the command line together with the ``--pyargs``
171183
option. Thanks to `@taschini`_ for the PR (`#1597`_).
172184

173-
* Add proposal to docs for a new feature that enables users to combine multiple
174-
fixtures into one. Thanks to `@hpk42`_ and `@hackebrot`_.
175-
176-
* Rename ``getfuncargvalue`` to ``getfixturevalue``. ``getfuncargvalue`` is
177-
deprecated but still present. Thanks to `@RedBeardCode`_ and `@tomviner`_
178-
for PR (`#1626`_).
179-
180-
* Always include full assertion explanation. The previous behaviour was hiding
181-
sub-expressions that happened to be False, assuming this was redundant information.
185+
* Always include full assertion explanation during assertion rewriting. The previous behaviour was hiding
186+
sub-expressions that happened to be ``False``, assuming this was redundant information.
182187
Thanks `@bagerard`_ for reporting (`#1503`_). Thanks to `@davehunt`_ and
183-
`@tomviner`_ for PR.
188+
`@tomviner`_ for the PR.
184189

185190
* ``OptionGroup.addoption()`` now checks if option names were already
186191
added before, to make it easier to track down issues like `#1618`_.
@@ -194,6 +199,10 @@
194199
removed in pytest-4.0 (`#1684`_).
195200
Thanks `@nicoddemus`_ for the PR.
196201

202+
* Rename ``getfuncargvalue`` to ``getfixturevalue``. ``getfuncargvalue`` is
203+
still present but is now considered deprecated. Thanks to `@RedBeardCode`_ and `@tomviner`_
204+
for the PR (`#1626`_).
205+
197206
*
198207

199208
*
@@ -202,22 +211,21 @@
202211

203212
**Bug Fixes**
204213

205-
* When receiving identical test ids in parametrize we generate unique test ids.
214+
* Parametrize now correctly handles duplicated test ids.
206215

207-
* Fix internal error issue when ``method`` argument is missing for
208-
``teardown_method()``. Fixes `#1605`_.
216+
* Fix internal error issue when the ``method`` argument is missing for
217+
``teardown_method()`` (`#1605`_).
209218

210219
* Fix exception visualization in case the current working directory (CWD) gets
211-
deleted during testing. Fixes `#1235`_. Thanks `@bukzor`_ for reporting. PR by
212-
`@marscher`_. Thanks `@nicoddemus`_ for his help.
220+
deleted during testing (`#1235`_). Thanks `@bukzor`_ for reporting. PR by
221+
`@marscher`_.
213222

214-
* Improve of the test output for logical expression with brackets.
215-
Fixes `#925`_. Thanks `@DRMacIver`_ for reporting. Thanks to `@RedBeardCode`_
216-
for PR.
223+
* Improve test output for logical expression with brackets (`#925`_).
224+
Thanks `@DRMacIver`_ for reporting and `@RedBeardCode`_ for the PR.
217225

218-
* Create correct diff for strings ending with newlines. Fixes `#1553`_.
219-
Thanks `@Vogtinator`_ for reporting. Thanks to `@RedBeardCode`_ and
220-
`@tomviner`_ for PR.
226+
* Create correct diff for strings ending with newlines (`#1553`_).
227+
Thanks `@Vogtinator`_ for reporting and `@RedBeardCode`_ and
228+
`@tomviner`_ for the PR.
221229

222230
*
223231

0 commit comments

Comments
 (0)