You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2019/05/07 20:11:22 UTC

[beam] branch master updated: [BEAM-6986] TypeHints Py3 Error: Multiple tests fail with a generator StopIteration error on Python 3.7 (#8497)

This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new fe73353  [BEAM-6986] TypeHints Py3 Error: Multiple tests fail with a generator StopIteration error on Python 3.7 (#8497)
fe73353 is described below

commit fe73353b6789b1a7bf93f55e9a0c3567486efd03
Author: Niklas Hansson <ni...@gmail.com>
AuthorDate: Tue May 7 22:11:02 2019 +0200

    [BEAM-6986] TypeHints Py3 Error: Multiple tests fail with a generator StopIteration error on Python 3.7 (#8497)
    
    * [BEAM-6986] fixed test failure with StopIteration error on python3.7
    
    * Remove unneeded imports.
---
 sdks/python/apache_beam/typehints/decorators.py     | 3 +--
 sdks/python/apache_beam/typehints/typehints_test.py | 6 ------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/sdks/python/apache_beam/typehints/decorators.py b/sdks/python/apache_beam/typehints/decorators.py
index 7d2441e..3c27e00 100644
--- a/sdks/python/apache_beam/typehints/decorators.py
+++ b/sdks/python/apache_beam/typehints/decorators.py
@@ -608,7 +608,6 @@ class GeneratorWrapper(object):
   next = __next__
 
   def __iter__(self):
-    while True:
-      x = next(self.internal_gen)
+    for x in self.internal_gen:
       self.interleave_func(x)
       yield x
diff --git a/sdks/python/apache_beam/typehints/typehints_test.py b/sdks/python/apache_beam/typehints/typehints_test.py
index f8fb61e..f002cd0 100644
--- a/sdks/python/apache_beam/typehints/typehints_test.py
+++ b/sdks/python/apache_beam/typehints/typehints_test.py
@@ -21,8 +21,6 @@ from __future__ import absolute_import
 
 import functools
 import inspect
-import os
-import sys
 import unittest
 from builtins import next
 from builtins import range
@@ -711,10 +709,6 @@ class IterableHintTestCase(TypeHintTestCase):
     self.assertIsNone(hint.type_check(l))
 
 
-@unittest.skipIf(sys.version_info >= (3, 7, 0) and
-                 os.environ.get('RUN_SKIPPED_PY3_TESTS') != '1',
-                 'This test still needs to be fixed on Python 3.7. '
-                 'See BEAM-6986')
 class TestGeneratorWrapper(TypeHintTestCase):
 
   def test_functions_as_regular_generator(self):