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

« back to all changes in this revision

Viewing changes to Lib/lib2to3/tests/data/py3_test_grammar.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:
868
868
        self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6])
869
869
        self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9])
870
870
 
 
871
    def test_with_statement(self):
 
872
        class manager(object):
 
873
            def __enter__(self):
 
874
                return (1, 2)
 
875
            def __exit__(self, *args):
 
876
                pass
 
877
 
 
878
        with manager():
 
879
            pass
 
880
        with manager() as x:
 
881
            pass
 
882
        with manager() as (x, y):
 
883
            pass
 
884
        with manager(), manager():
 
885
            pass
 
886
        with manager() as x, manager() as y:
 
887
            pass
 
888
        with manager() as x, manager():
 
889
            pass
 
890
 
871
891
    def testIfElseExpr(self):
872
892
        # Test ifelse expressions in various cases
873
893
        def _checkeval(msg, ret):