~cprov/pyflakes/test-packaging

« back to all changes in this revision

Viewing changes to pyflakes/test/test_undefined_names.py

  • Committer: moe
  • Date: 2008-11-27 12:15:54 UTC
  • Revision ID: vcs-imports@canonical.com-20081127121554-kgij8zqmpfkvcoxj
merge pyflakes-builtins-2795.  updates Pyflakes to recognize __builtins__ as a defined name.  author: moe, reviewer: mithrandi.  closes #2795

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    def test_builtins(self):
25
25
        self.flakes('range(10)')
26
26
 
27
 
    def test_magic_globals(self):
 
27
 
 
28
    def test_magicGlobalsFile(self):
 
29
        """
 
30
        Use of the C{__file__} magic global should not emit an undefined name
 
31
        warning.
 
32
        """
28
33
        self.flakes('__file__')
29
34
 
 
35
 
 
36
    def test_magicGlobalsBuiltins(self):
 
37
        """
 
38
        Use of the C{__builtins__} magic global should not emit an undefined
 
39
        name warning.
 
40
        """
 
41
        self.flakes('__builtins__')
 
42
 
 
43
 
 
44
    def test_magicGlobalsName(self):
 
45
        """
 
46
        Use of the C{__name__} magic global should not emit an undefined name
 
47
        warning.
 
48
        """
 
49
        self.flakes('__name__')
 
50
 
 
51
 
30
52
    def test_globalImportStar(self):
31
53
        '''Can't find undefined names with import *'''
32
54
        self.flakes('from fu import *; bar', m.ImportStarUsed)