Skip to content

Commit f5d900d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into features
2 parents 9d2149d + 96a1d29 commit f5d900d

29 files changed

Lines changed: 206 additions & 81 deletions

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Martin Prusse
9191
Matt Bachmann
9292
Matt Williams
9393
Matthias Hafner
94+
mbyt
9495
Michael Aquilina
9596
Michael Birtwell
9697
Michael Droettboom

CHANGELOG.rst

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,53 @@
33

44
*
55

6+
*
7+
8+
*
9+
10+
*
11+
12+
*
13+
14+
15+
3.0.2
16+
=====
17+
618
* Improve error message when passing non-string ids to ``pytest.mark.parametrize`` (`#1857`_).
719
Thanks `@okken`_ for the report and `@nicoddemus`_ for the PR.
820

921
* Add ``buffer`` attribute to stdin stub class ``pytest.capture.DontReadFromInput``
1022
Thanks `@joguSD`_ for the PR.
1123

1224
* Fix ``UnicodeEncodeError`` when string comparison with unicode has failed. (`#1864`_)
13-
Thanks `@AiOO`_ for the PR
14-
15-
*
25+
Thanks `@AiOO`_ for the PR.
26+
27+
* ``pytest_plugins`` is now handled correctly if defined as a string (as opposed as
28+
a sequence of strings) when modules are considered for assertion rewriting.
29+
Due to this bug, much more modules were being rewritten than necessary
30+
if a test suite uses ``pytest_plugins`` to load internal plugins (`#1888`_).
31+
Thanks `@jaraco`_ for the report and `@nicoddemus`_ for the PR (`#1891`_).
32+
33+
* Do not call tearDown and cleanups when running tests from
34+
``unittest.TestCase`` subclasses with ``--pdb``
35+
enabled. This allows proper post mortem debugging for all applications
36+
which have significant logic in their tearDown machinery (`#1890`_). Thanks
37+
`@mbyt`_ for the PR.
38+
39+
* Fix use of deprecated ``getfuncargvalue`` method in the internal doctest plugin.
40+
Thanks `@ViviCoder`_ for the report (`#1898`_).
1641

1742
.. _@joguSD: https://github.com/joguSD
1843
.. _@AiOO: https://github.com/AiOO
44+
.. _@mbyt: https://github.com/mbyt
45+
.. _@ViviCoder: https://github.com/ViviCoder
1946

2047
.. _#1857: https://github.com/pytest-dev/pytest/issues/1857
2148
.. _#1864: https://github.com/pytest-dev/pytest/issues/1864
49+
.. _#1888: https://github.com/pytest-dev/pytest/issues/1888
50+
.. _#1891: https://github.com/pytest-dev/pytest/pull/1891
51+
.. _#1890: https://github.com/pytest-dev/pytest/issues/1890
52+
.. _#1898: https://github.com/pytest-dev/pytest/issues/1898
2253

2354

2455
3.0.2.dev

HOWTORELEASE.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ Note: this assumes you have already registered on pypi.
6464
a. **patch release (2.8.3)**:
6565

6666
1. Checkout ``master``.
67-
2. Update version number in ``_pytest/__init__.py`` to ``"2.8.4.dev"``.
68-
3. Create a new section in ``CHANGELOG.rst`` titled ``2.8.4.dev`` and add a few bullet points as placeholders for new entries.
67+
2. Update version number in ``_pytest/__init__.py`` to ``"2.8.4.dev0"``.
68+
3. Create a new section in ``CHANGELOG.rst`` titled ``2.8.4.dev0`` and add a few bullet points as placeholders for new entries.
6969
4. Commit and push.
7070

7171
b. **minor release (2.9.0)**:
7272

7373
1. Merge ``features`` into ``master``.
7474
2. Checkout ``master``.
75-
3. Follow the same steps for a **patch release** above, using the next patch release: ``2.9.1.dev``.
75+
3. Follow the same steps for a **patch release** above, using the next patch release: ``2.9.1.dev0``.
7676
4. Commit ``master``.
7777
5. Checkout ``features`` and merge with ``master`` (should be a fast-forward at this point).
78-
6. Update version number in ``_pytest/__init__.py`` to the next minor release: ``"2.10.0.dev"``.
79-
7. Create a new section in ``CHANGELOG.rst`` titled ``2.10.0.dev``, above ``2.9.1.dev``, and add a few bullet points as placeholders for new entries.
78+
6. Update version number in ``_pytest/__init__.py`` to the next minor release: ``"2.10.0.dev0"``.
79+
7. Create a new section in ``CHANGELOG.rst`` titled ``2.10.0.dev0``, above ``2.9.1.dev0``, and add a few bullet points as placeholders for new entries.
8080
8. Commit ``features``.
8181
9. Push ``master`` and ``features``.
8282

_pytest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#
2-
__version__ = '3.1.0.dev'
2+
__version__ = '3.1.0.dev0'

_pytest/assertion/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ def register_assert_rewrite(*names):
3636
Thus you should make sure to call this before the module is
3737
actually imported, usually in your __init__.py if you are a plugin
3838
using a package.
39+
40+
:raise TypeError: if the given module names are not strings.
3941
"""
42+
for name in names:
43+
if not isinstance(name, str):
44+
msg = 'expected module names as *args, got {0} instead'
45+
raise TypeError(msg.format(repr(names)))
4046
for hook in sys.meta_path:
4147
if isinstance(hook, rewrite.AssertionRewritingHook):
4248
importhook = hook

_pytest/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ def consider_env(self):
379379

380380
def consider_module(self, mod):
381381
plugins = getattr(mod, 'pytest_plugins', [])
382+
if isinstance(plugins, str):
383+
plugins = [plugins]
382384
self.rewrite_hook.mark_rewrite(*plugins)
383385
self._import_plugin_specs(plugins)
384386

_pytest/doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def setup(self):
8888
if self.dtest is not None:
8989
self.fixture_request = _setup_fixtures(self)
9090
globs = dict(getfixture=self.fixture_request.getfixturevalue)
91-
for name, value in self.fixture_request.getfuncargvalue('doctest_namespace').items():
91+
for name, value in self.fixture_request.getfixturevalue('doctest_namespace').items():
9292
globs[name] = value
9393
self.dtest.globs.update(globs)
9494

_pytest/unittest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ def stopTest(self, testcase):
150150
pass
151151

152152
def runtest(self):
153-
self._testcase(result=self)
153+
if self.config.pluginmanager.get_plugin("pdbinvoke") is None:
154+
self._testcase(result=self)
155+
else:
156+
# disables tearDown and cleanups for post mortem debugging (see #1890)
157+
self._testcase.debug()
158+
154159

155160
def _prunetraceback(self, excinfo):
156161
pytest.Function._prunetraceback(self, excinfo)

doc/en/announce/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ Release announcements
55
.. toctree::
66
:maxdepth: 2
77

8-
9-
sprint2016
8+
9+
release-3.0.2
1010
release-3.0.1
1111
release-3.0.0
12+
sprint2016
1213
release-2.9.2
1314
release-2.9.1
1415
release-2.9.0

doc/en/announce/release-3.0.2.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pytest-3.0.2
2+
============
3+
4+
pytest 3.0.2 has just been released to PyPI.
5+
6+
This release fixes some regressions and bugs reported in version 3.0.1, being a
7+
drop-in replacement. To upgrade::
8+
9+
pip install --upgrade pytest
10+
11+
The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
12+
13+
Thanks to all who contributed to this release, among them:
14+
15+
* Ahn Ki-Wook
16+
* Bruno Oliveira
17+
* Florian Bruhin
18+
* Jordan Guymon
19+
* Raphael Pierzina
20+
* Ronny Pfannschmidt
21+
* mbyt
22+
23+
Happy testing,
24+
The pytest Development Team

0 commit comments

Comments
 (0)