Skip to content

Commit 176c680

Browse files
authored
Merge branch 'master' into allow_skipping_unittests_with_pdb_active
2 parents 36b6f17 + da5a3db commit 176c680

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
3.0.7 (unreleased)
2-
=======================
2+
==================
33

44
* Fix regression, pytest now skips unittest correctly if run with ``--pdb``
55
(`#2137`_). Thanks to `@gst`_ for the report and `@mbyt`_ for the PR.
66

7+
* Replace ``raise StopIteration`` usages in the code by simple ``returns`` to finish generators, in accordance to `PEP-479`_ (`#2160`_).
8+
Thanks `@tgoodlet`_ for the report and `@nicoddemus`_ for the PR.
9+
710
*
811

912
*
@@ -13,6 +16,9 @@
1316
.. _@gst: https://github.com/gst
1417

1518
.. _#2137: https://github.com/pytest-dev/pytest/issues/2137
19+
.. _#2160: https://github.com/pytest-dev/pytest/issues/2160
20+
21+
.. _PEP-479: https://www.python.org/dev/peps/pep-0479/
1622

1723

1824
3.0.6 (2017-01-22)

_pytest/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def pytest_pycollect_makeitem(collector, name, obj):
174174
outcome = yield
175175
res = outcome.get_result()
176176
if res is not None:
177-
raise StopIteration
177+
return
178178
# nothing was collected elsewhere, let's do it here
179179
if isclass(obj):
180180
if collector.istestclass(obj, name):

0 commit comments

Comments
 (0)