Merge pull request #2226 from nicoddemus/raise-stop-iteration
Replace 'raise StopIteration' usages in the code by 'return's in accordance to PEP-479
This commit is contained in:
		
						commit
						da5a3dba87
					
				|  | @ -1,5 +1,10 @@ | ||||||
| 3.0.7 (unreleased) | 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. | ||||||
| 
 | 
 | ||||||
| * | * | ||||||
| 
 | 
 | ||||||
|  | @ -7,7 +12,9 @@ | ||||||
| 
 | 
 | ||||||
| * | * | ||||||
| 
 | 
 | ||||||
| * | .. _#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) | 3.0.6 (2017-01-22) | ||||||
|  |  | ||||||
|  | @ -174,7 +174,7 @@ def pytest_pycollect_makeitem(collector, name, obj): | ||||||
|     outcome = yield |     outcome = yield | ||||||
|     res = outcome.get_result() |     res = outcome.get_result() | ||||||
|     if res is not None: |     if res is not None: | ||||||
|         raise StopIteration |         return | ||||||
|     # nothing was collected elsewhere, let's do it here |     # nothing was collected elsewhere, let's do it here | ||||||
|     if isclass(obj): |     if isclass(obj): | ||||||
|         if collector.istestclass(obj, name): |         if collector.istestclass(obj, name): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue