~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/test/test_py3kwarn.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
            exec "`2`" in {}
32
32
        self.assertWarning(None, w, expected)
33
33
 
 
34
    def test_paren_arg_names(self):
 
35
        expected = 'parenthesized argument names are invalid in 3.x'
 
36
        def check(s):
 
37
            exec s in {}
 
38
            self.assertWarning(None, w, expected)
 
39
        with check_warnings() as w:
 
40
            check("def f((x)): pass")
 
41
            check("def f((((x))), (y)): pass")
 
42
            check("def f((x), (((y))), m=32): pass")
 
43
            # Something like def f((a, (b))): pass will raise the tuple
 
44
            # unpacking warning.
 
45
 
34
46
    def test_bool_assign(self):
35
47
        # So we don't screw up our globals
36
48
        def safe_exec(expr):
321
333
                           'sunos5' : ('sunaudiodev', 'SUNAUDIODEV'),
322
334
                          }
323
335
    optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop',
324
 
                        'sv', 'cPickle', 'bsddb', 'dbhash')
 
336
                        'sv', 'bsddb', 'dbhash')
325
337
 
326
338
    def check_removal(self, module_name, optional=False):
327
339
        """Make sure the specified module, when imported, raises a