Skip to content

Commit

Permalink
Merge pull request #2226 from nicoddemus/raise-stop-iteration
Browse files Browse the repository at this point in the history
Replace 'raise StopIteration' usages in the code by 'return's in accordance to PEP-479
  • Loading branch information
RonnyPfannschmidt authored Feb 1, 2017
2 parents 0931fe2 + e1c5314 commit da5a3db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
3.0.7 (unreleased)
=======================
==================

*

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

*

*

*

.. _#2160: https://github.com/pytest-dev/pytest/issues/2160

.. _PEP-479: https://www.python.org/dev/peps/pep-0479/


3.0.6 (2017-01-22)
==================
Expand Down
2 changes: 1 addition & 1 deletion _pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def pytest_pycollect_makeitem(collector, name, obj):
outcome = yield
res = outcome.get_result()
if res is not None:
raise StopIteration
return
# nothing was collected elsewhere, let's do it here
if isclass(obj):
if collector.istestclass(obj, name):
Expand Down

0 comments on commit da5a3db

Please sign in to comment.