1pytest-2.9.0
2============
3
4pytest is a mature Python testing tool with more than a 1100 tests
5against itself, passing on many different interpreters and platforms.
6
7See below for the changes and see docs at:
8
9    http://pytest.org
10
11As usual, you can upgrade from pypi via::
12
13    pip install -U pytest
14
15Thanks to all who contributed to this release, among them:
16
17    Anatoly Bubenkov
18    Bruno Oliveira
19    Buck Golemon
20    David Vierra
21    Florian Bruhin
22    Galaczi Endre
23    Georgy Dyuldin
24    Lukas Bednar
25    Luke Murphy
26    Marcin Biernat
27    Matt Williams
28    Michael Aquilina
29    Raphael Pierzina
30    Ronny Pfannschmidt
31    Ryan Wooden
32    Tiemo Kieft
33    TomV
34    holger krekel
35    jab
36
37
38Happy testing,
39The py.test Development Team
40
41
422.9.0 (compared to 2.8.7)
43-------------------------
44
45**New Features**
46
47* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
48  Thanks `@MichaelAquilina`_ for the complete PR (`#1040`_).
49
50* ``--doctest-glob`` may now be passed multiple times in the command-line.
51  Thanks `@jab`_ and `@nicoddemus`_ for the PR.
52
53* New ``-rp`` and ``-rP`` reporting options give the summary and full output
54  of passing tests, respectively. Thanks to `@codewarrior0`_ for the PR.
55
56* ``pytest.mark.xfail`` now has a ``strict`` option which makes ``XPASS``
57  tests to fail the test suite, defaulting to ``False``. There's also a
58  ``xfail_strict`` ini option that can be used to configure it project-wise.
59  Thanks `@rabbbit`_ for the request and `@nicoddemus`_ for the PR (`#1355`_).
60
61* ``Parser.addini`` now supports options of type ``bool``. Thanks
62  `@nicoddemus`_ for the PR.
63
64* New ``ALLOW_BYTES`` doctest option strips ``b`` prefixes from byte strings
65  in doctest output (similar to ``ALLOW_UNICODE``).
66  Thanks `@jaraco`_ for the request and `@nicoddemus`_ for the PR (`#1287`_).
67
68* give a hint on KeyboardInterrupt to use the --fulltrace option to show the errors,
69  this fixes `#1366`_.
70  Thanks to `@hpk42`_ for the report and `@RonnyPfannschmidt`_ for the PR.
71
72* catch IndexError exceptions when getting exception source location. This fixes
73  pytest internal error for dynamically generated code (fixtures and tests)
74  where source lines are fake by intention
75
76**Changes**
77
78* **Important**: `py.code <http://pylib.readthedocs.org/en/latest/code.html>`_ has been
79  merged into the ``pytest`` repository as ``pytest._code``. This decision
80  was made because ``py.code`` had very few uses outside ``pytest`` and the
81  fact that it was in a different repository made it difficult to fix bugs on
82  its code in a timely manner. The team hopes with this to be able to better
83  refactor out and improve that code.
84  This change shouldn't affect users, but it is useful to let users aware
85  if they encounter any strange behavior.
86
87  Keep in mind that the code for ``pytest._code`` is **private** and
88  **experimental**, so you definitely should not import it explicitly!
89
90  Please note that the original ``py.code`` is still available in
91  `pylib <http://pylib.readthedocs.org>`_.
92
93* ``pytest_enter_pdb`` now optionally receives the pytest config object.
94  Thanks `@nicoddemus`_ for the PR.
95
96* Removed code and documentation for Python 2.5 or lower versions,
97  including removal of the obsolete ``_pytest.assertion.oldinterpret`` module.
98  Thanks `@nicoddemus`_ for the PR (`#1226`_).
99
100* Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is
101  found in the environment, even when -vv isn't used.
102  Thanks `@The-Compiler`_ for the PR.
103
104* ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and
105  ``--failed-first`` respectively.
106  Thanks `@MichaelAquilina`_ for the PR.
107
108* Added expected exceptions to pytest.raises fail message
109
110* Collection only displays progress ("collecting X items") when in a terminal.
111  This avoids cluttering the output when using ``--color=yes`` to obtain
112  colors in CI integrations systems (`#1397`_).
113
114**Bug Fixes**
115
116* The ``-s`` and ``-c`` options should now work under ``xdist``;
117  ``Config.fromdictargs`` now represents its input much more faithfully.
118  Thanks to `@bukzor`_ for the complete PR (`#680`_).
119
120* Fix (`#1290`_): support Python 3.5's ``@`` operator in assertion rewriting.
121  Thanks `@Shinkenjoe`_ for report with test case and `@tomviner`_ for the PR.
122
123* Fix formatting utf-8 explanation messages (`#1379`_).
124  Thanks `@biern`_ for the PR.
125
126* Fix `traceback style docs`_ to describe all of the available options
127  (auto/long/short/line/native/no), with `auto` being the default since v2.6.
128  Thanks `@hackebrot`_ for the PR.
129
130* Fix (`#1422`_): junit record_xml_property doesn't allow multiple records
131  with same name.
132
133
134.. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing
135
136.. _#1422: https://github.com/pytest-dev/pytest/issues/1422
137.. _#1379: https://github.com/pytest-dev/pytest/issues/1379
138.. _#1366: https://github.com/pytest-dev/pytest/issues/1366
139.. _#1040: https://github.com/pytest-dev/pytest/pull/1040
140.. _#680: https://github.com/pytest-dev/pytest/issues/680
141.. _#1287: https://github.com/pytest-dev/pytest/pull/1287
142.. _#1226: https://github.com/pytest-dev/pytest/pull/1226
143.. _#1290: https://github.com/pytest-dev/pytest/pull/1290
144.. _#1355: https://github.com/pytest-dev/pytest/pull/1355
145.. _#1397: https://github.com/pytest-dev/pytest/issues/1397
146.. _@biern: https://github.com/biern
147.. _@MichaelAquilina: https://github.com/MichaelAquilina
148.. _@bukzor: https://github.com/bukzor
149.. _@hpk42: https://github.com/hpk42
150.. _@nicoddemus: https://github.com/nicoddemus
151.. _@jab: https://github.com/jab
152.. _@codewarrior0: https://github.com/codewarrior0
153.. _@jaraco: https://github.com/jaraco
154.. _@The-Compiler: https://github.com/The-Compiler
155.. _@Shinkenjoe: https://github.com/Shinkenjoe
156.. _@tomviner: https://github.com/tomviner
157.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
158.. _@rabbbit: https://github.com/rabbbit
159.. _@hackebrot: https://github.com/hackebrot