diff options
author | Mike Taves <mwtoews@gmail.com> | 2020-01-28 13:12:38 +1300 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-01-27 16:12:38 -0800 |
commit | f398a0df8a2105b2fdeaeab54505451169b0a869 (patch) | |
tree | fe041dbec09eb1a303f7b027cc98e7423476de3f /numpy/testing/tests | |
parent | 6d889e7eca0f7ae6d640c380bd0b604e6530f049 (diff) | |
download | numpy-f398a0df8a2105b2fdeaeab54505451169b0a869.tar.gz |
STY: use 'yield from <expr>' for simple cases (#15444)
This PR uses simple cases of PEP 380 to rewrite:
for v in g:
yield v
into:
yield from <expr>
Diffstat (limited to 'numpy/testing/tests')
-rw-r--r-- | numpy/testing/tests/test_decorators.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/numpy/testing/tests/test_decorators.py b/numpy/testing/tests/test_decorators.py index 77f8b66ba..b60d6dfbc 100644 --- a/numpy/testing/tests/test_decorators.py +++ b/numpy/testing/tests/test_decorators.py @@ -106,8 +106,7 @@ class TestNoseDecorators: def test_skip_generators_hardcoded(self): @dec.knownfailureif(True, "This test is known to fail") def g1(x): - for i in range(x): - yield i + yield from range(x) try: for j in g1(10): @@ -119,8 +118,7 @@ class TestNoseDecorators: @dec.knownfailureif(False, "This test is NOT known to fail") def g2(x): - for i in range(x): - yield i + yield from range(x) raise self.DidntSkipException('FAIL') try: @@ -137,8 +135,7 @@ class TestNoseDecorators: @dec.knownfailureif(skip_tester, "This test is known to fail") def g1(x): - for i in range(x): - yield i + yield from range(x) try: skip_flag = 'skip me!' @@ -151,8 +148,7 @@ class TestNoseDecorators: @dec.knownfailureif(skip_tester, "This test is NOT known to fail") def g2(x): - for i in range(x): - yield i + yield from range(x) raise self.DidntSkipException('FAIL') try: |