2 from test
import test_support
5 test_support
.import_module('compiler', deprecated
=True)
6 from compiler
import transformer
, ast
7 from compiler
import compile
9 class Tests(unittest
.TestCase
):
11 def testMultipleLHS(self
):
12 """ Test multiple targets on the left hand side. """
14 snippets
= ['a, b = 1, 2',
16 '((a, b), c) = (1, 2), 3']
19 a
= transformer
.parse(s
)
20 self
.assertIsInstance(a
, ast
.Module
)
21 child1
= a
.getChildNodes()[0]
22 self
.assertIsInstance(child1
, ast
.Stmt
)
23 child2
= child1
.getChildNodes()[0]
24 self
.assertIsInstance(child2
, ast
.Assign
)
26 # This actually tests the compiler, but it's a way to assure the ast
28 c
= compile(s
, '<string>', 'single')
35 test_support
.run_unittest(Tests
)
37 if __name__
== "__main__":