~anitanayak/charms/xenial/ibm-cinder-storwize-svc/ibm-cinder-storwize-svc-branch

« back to all changes in this revision

Viewing changes to .tox/py35/lib/python3.5/site-packages/pyflakes/test/test_return_with_arguments_inside_generator.py

  • Committer: anitanayak at ibm
  • Date: 2017-02-10 06:50:04 UTC
  • Revision ID: anitanayak@in.ibm.com-20170210065004-u91ao35ppbamd5vi
Check in after removing all hardcoded values

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
from sys import version_info
3
 
 
4
 
from pyflakes import messages as m
5
 
from pyflakes.test.harness import TestCase, skipIf
6
 
 
7
 
 
8
 
class Test(TestCase):
9
 
    @skipIf(version_info >= (3, 3), 'new in Python 3.3')
10
 
    def test_return(self):
11
 
        self.flakes('''
12
 
        class a:
13
 
            def b():
14
 
                for x in a.c:
15
 
                    if x:
16
 
                        yield x
17
 
                return a
18
 
        ''', m.ReturnWithArgsInsideGenerator)
19
 
 
20
 
    @skipIf(version_info >= (3, 3), 'new in Python 3.3')
21
 
    def test_returnNone(self):
22
 
        self.flakes('''
23
 
        def a():
24
 
            yield 12
25
 
            return None
26
 
        ''', m.ReturnWithArgsInsideGenerator)
27
 
 
28
 
    @skipIf(version_info >= (3, 3), 'new in Python 3.3')
29
 
    def test_returnYieldExpression(self):
30
 
        self.flakes('''
31
 
        def a():
32
 
            b = yield a
33
 
            return b
34
 
        ''', m.ReturnWithArgsInsideGenerator)