python (3.11.7)

(root)/
lib/
python3.11/
lib2to3/
tests/
__pycache__/
test_fixers.cpython-311.opt-2.pyc

eV	ddlZddlmZddlmZddlmZmZddlm	Z	Gdde	j
ZGdd	eZGd
deZ
Gdd
eZGddeZGddeZGddeZGddeZGddeZGddeZGddeZGddeZGddeZGd d!eZGd"d#eZGd$d%eZGd&d'eZGd(d)eZGd*d+eZGd,d-eZGd.d/eZGd0d1eZ Gd2d3Z!Gd4d5ee!Z"Gd6d7ee!Z#Gd8d9ee!Z$Gd:d;eZ%Gd<d=eZ&Gd>d?eZ'Gd@dAeZ(GdBdCeZ)GdDdEeZ*GdFdGeZ+GdHdIeZ,GdJdKeZ-GdLdMeZ.GdNdOeZ/GdPdQeZ0GdRdSeZ1GdTdUeZ2GdVdWeZ3GdXdYeZ4GdZd[eZ5Gd\d]eZ6Gd^d_eZ7Gd`daeZ8GdbdceZ9GdddeeZ:GdfdgeZ;GdhdieZ<GdjdkeZ=GdldmeZ>GdndoeZ?GdpdqeZ@GdrdseZAdS)tN)chain)
itemgetter)pygram
fixer_util)supportc@eZdZddZdZddZddZdZdd	Zd
Z	dS)

FixerTestCaseNlib2to3c||jg}tj||||_g|_d|_t
|jj|jjD]}|j|_	dS)Nz<string>)
fixerrget_refactorerrefactor	fixer_logfilenamer	pre_order
post_orderlog)selffix_list	fixer_pkgoptionsrs     M/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/lib2to3/tests/test_fixers.pysetUpzFixerTestCase.setUpsr
|H.y(GLL
"
4=2=355	'	'EEII	'	'ctj|}tj|}|j||j}||t
||SN)rreformatrrefactor_stringrassertEqualstr)rbeforeaftertrees    r_checkzFixerTestCase._checks\!&)) ''},,VT]CCD		***rFc|||}||j|s||jgdSdSr)r$
assertTruewas_changedrr)rr!r"ignore_warningsr#s     rcheckzFixerTestCase.check#sZ{{65))()))	1T^R00000	1	1rc|||}||d|j|s||jdSdS)N)r$assertInjoinrr&r')rr!r"message	unchangedr#s      rwarnszFixerTestCase.warns)sd{{65))

grwwt~66777	.OOD,-----	.	.rc8||||ddS)NTr/r0)rr!r.s   rwarns_unchangedzFixerTestCase.warns_unchanged/s"

667d
;;;;;rcp||||s||jgdSdSr)r$rr)rr!r(s   rr/zFixerTestCase.unchanged2sFFF###	1T^R00000	1	1rc|jg}||tjd|}|\}}d|jz}|r'|djj|rdS|r)|djj|r|sdS|dd	d||zDd|ddS)	Nr
fix_zFixer run order (, c&g|]}|jjS)	__class__
__module__).0xs  r
<listcomp>z3FixerTestCase.assert_runs_after.<locals>.<listcomp>DsGGGqAK2GGGrz) is incorrect; z should be last.)
rextendrr

get_fixersr<r=endswithfailr-)rnamesfixesrprepostns       rassert_runs_afterzFixerTestCase.assert_runs_after7s
U"9e44llnndTZ	DH&1::1==	F	3r7$/88;;	D	F			GGSXGGGHHHH!!!M	N	N	N	N	Nr)Nr
N)F)
__name__r=__qualname__rr$r)r0r4r/rKr;rrr	r	
s	'	'	'	'1111....<<<1111

N
N
N
N
Nrr	c$eZdZdZdZdZdZdS)Test_nenec:d}d}|||dS)Nzif x <> y:
            passzif x != y:
            passr)rbas   r
test_basiczTest_ne.test_basicI*



1arc:d}d}|||dS)Nzif x<>y:
            passzif x!=y:
            passrRrSs   rtest_no_spaceszTest_ne.test_no_spacesQrWrc:d}d}|||dS)Nzif x<>y<>z:
            passzif x!=y!=z:
            passrRrSs   rtest_chainedzTest_ne.test_chainedYrWrN)rLr=rMrrVrYr[r;rrrOrOFsFErrOcTeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
S)Test_has_keyhas_keyc:d}d}|||dS)Nz$x = d.has_key("x") or d.has_key("y")zx = "x" in d or "y" in drRrSs   rtest_1zTest_has_key.test_1ds&6*

1arc:d}d}|||dS)Nzx = a.b.c.d.has_key("x") ** 3zx = ("x" in a.b.c.d) ** 3rRrSs   rtest_2zTest_has_key.test_2i&/+

1arc:d}d}|||dS)Nz!x = a.b.has_key(1 + 2).__repr__()zx = (1 + 2 in a.b).__repr__()rRrSs   rtest_3zTest_has_key.test_3ns&3/

1arc:d}d}|||dS)Nz,x = a.b.has_key(1 + 2).__repr__() ** -3 ** 4z(x = (1 + 2 in a.b).__repr__() ** -3 ** 4rRrSs   rtest_4zTest_has_key.test_4ss&>:

1arc:d}d}|||dS)Nzx = a.has_key(f or g)zx = (f or g) in arRrSs   rtest_5zTest_has_key.test_5x&'#

1arc:d}d}|||dS)Nzx = a + b.has_key(c)zx = a + (c in b)rRrSs   rtest_6zTest_has_key.test_6}&&"

1arc:d}d}|||dS)Nzx = a.has_key(lambda: 12)zx = (lambda: 12) in arRrSs   rtest_7zTest_has_key.test_7&+'

1arc:d}d}|||dS)Nzx = a.has_key(a for a in b)zx = (a for a in b) in arRrSs   rtest_8zTest_has_key.test_8s&-)

1arc:d}d}|||dS)Nzif not a.has_key(b): passzif b not in a: passrRrSs   rtest_9zTest_has_key.test_9s&+%

1arc:d}d}|||dS)Nz$if not a.has_key(b).__repr__(): passz if not (b in a).__repr__(): passrRrSs   rtest_10zTest_has_key.test_10s&62

1arc:d}d}|||dS)Nzif not a.has_key(b) ** 2: passzif not (b in a) ** 2: passrRrSs   rtest_11zTest_has_key.test_11s&0,

1arN)rLr=rMrr`rbrergrirlrorrrtrvrxr;rrr]r]asE









rr]ceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdS)
Test_applyapplyc:d}d}|||dS)Nzx = apply(f, g + h)z
x = f(*g + h)rRrSs   rr`zTest_apply.test_1s&%

1arc:d}d}|||dS)Nzy = apply(f, g, h)zy = f(*g, **h)rRrSs   rrbzTest_apply.test_2s&$ 

1arc:d}d}|||dS)Nz z = apply(fs[0], g or h, h or g)zz = fs[0](*g or h, **h or g)rRrSs   rrezTest_apply.test_3&2.

1arc:d}d}|||dS)Nzapply(f, (x, y) + t)zf(*(x, y) + t)rRrSs   rrgzTest_apply.test_4&& 

1arc:d}d}|||dS)Nzapply(f, args,)f(*args)rRrSs   rrizTest_apply.test_5s&!

1arc:d}d}|||dS)Nzapply(f, args, kwds,)f(*args, **kwds)rRrSs   rrlzTest_apply.test_6s&'"

1arc:d}d}|||dS)Nzx = apply(f+g, args)zx = (f+g)(*args)rRrSs   rtest_complex_1zTest_apply.test_complex_1rmrc:d}d}|||dS)Nzx = apply(f*g, args)zx = (f*g)(*args)rRrSs   rtest_complex_2zTest_apply.test_complex_2rmrc:d}d}|||dS)Nzx = apply(f**g, args)zx = (f**g)(*args)rRrSs   rtest_complex_3zTest_apply.test_complex_3rjrc:d}d}|||dS)Nzx = apply(f.g, args)zx = f.g(*args)rRrSs   rtest_dotted_namezTest_apply.test_dotted_namerrc:d}d}|||dS)Nzx = apply(f[x], args)zx = f[x](*args)rRrSs   rtest_subscriptzTest_apply.test_subscripts&'!

1arc:d}d}|||dS)Nzx = apply(f(), args)zx = f()(*args)rRrSs   r	test_callzTest_apply.test_callrrc:d}d}|||dS)Nz"x = apply(a.b.c.d.e.f, args, kwds)zx = a.b.c.d.e.f(*args, **kwds)rRrSs   rtest_extremezTest_apply.test_extremes&40

1arc:d}d}|||dS)Nz1apply(   # foo
          f, # bar
          args)rrRrSs   rtest_weird_commentszTest_apply.test_weird_commentss*



1arc4d}||dS)Nzapply()r2rss  rtest_unchanged_1zTest_apply.test_unchanged_1sqrc4d}||dS)Nzapply(f)r2rs  rtest_unchanged_2zTest_apply.test_unchanged_2sqrc4d}||dS)Nz	apply(f,)r2rs  rtest_unchanged_3zTest_apply.test_unchanged_3sqrc4d}||dS)Nzapply(f, args, kwds, extras)r2rs  rtest_unchanged_4zTest_apply.test_unchanged_4.qrc4d}||dS)Nzapply(f, *args, **kwds)r2rs  rtest_unchanged_5zTest_apply.test_unchanged_5s)qrc4d}||dS)Nzapply(f, *args)r2rs  rtest_unchanged_6zTest_apply.test_unchanged_6!qrc4d}||dS)Nzapply(f, **kwds)r2rs  rtest_unchanged_6bzTest_apply.test_unchanged_6b"qrc4d}||dS)Nz#apply(func=f, args=args, kwds=kwds)r2rs  rtest_unchanged_7zTest_apply.test_unchanged_7
s5qrc4d}||dS)Nzapply(f, args=args, kwds=kwds)r2rs  rtest_unchanged_8zTest_apply.test_unchanged_80qrc4d}||dS)Nzapply(f, args, kwds=kwds)r2rs  rtest_unchanged_9zTest_apply.test_unchanged_9s+qrc:d}d}|||dS)Nzapply(  f,  args,   kwds)rrRrrUrTs   rtest_space_1zTest_apply.test_space_1&+"

1arc:d}d}|||dS)Nzapply(  f  ,args,kwds   )rrRrs   rtest_space_2zTest_apply.test_space_2rrN)rLr=rMrr`rbrergrirlrrrrrrrrrrrrrrrrrrrrr;rrrzrzsE









rrzc*eZdZdZdZdZdZdZdS)Test_reloadreloadc:d}d}|||dS)Nz	reload(a)z$import importlib
importlib.reload(a)rRrSs   rtestzTest_reload.test#s&7

1arcnd}d}|||d}d}|||dS)Nzreload( a ) # commentz0import importlib
importlib.reload( a ) # commentzreload( a )  # commentz1import importlib
importlib.reload( a )  # commentrRrSs   rtest_commentzTest_reload.test_comment(sF'C

1a
)D

1arcd}d}|||d}d}|||d}d}|||dS)Nzreload( a )z&import importlib
importlib.reload( a )z
reload( a)z%import importlib
importlib.reload( a)z
reload(a )z%import importlib
importlib.reload(a )rRrSs   r
test_spacezTest_reload.test_space2sb9

1a8

1a8

1arcd}||d}||d}||d}||d}||d}||d}||d}||d	}||dS)
Nzreload(a=1)zreload(f, g)z
reload(f, *h)zreload(f, *h, **i)zreload(f, **i)zreload(*h, **i)z
reload(*h)zreload(**i)zreload()r2rs  rtest_unchangedzTest_reload.test_unchanged?sqqq$q q!qqqqrN)rLr=rMrrrrrr;rrrr sUE
rrc$eZdZdZdZdZdZdS)Test_interninterncd}d}|||d}d}|||d}d}|||dS)Nzx =   intern(  a  )z"import sys
x =   sys.intern(  a  )z%y = intern("b" # test
              )z4import sys
y = sys.intern("b" # test
              )zz = intern(a+b+c.d,   )z&import sys
z = sys.intern(a+b+c.d,   )rRrSs   rtest_prefix_preservationz$Test_intern.test_prefix_preservation^sf%5

1a



1a)9

1arcd}d}|||d}d}|||d}d}|||dS)Nz
x = intern(a)zimport sys
x = sys.intern(a)zz = intern(a+b+c.d,)z#import sys
z = sys.intern(a+b+c.d,)z"intern("y%s" % 5).replace("y", "")z1import sys
sys.intern("y%s" % 5).replace("y", "")rRrSs   rrzTest_intern.testmsb/

1a&6

1a4D

1arcd}||d}||d}||d}||d}||dS)Nzintern(a=1)zintern(f, g)z
intern(*h)zintern(**i)zintern()r2rs  rrzTest_intern.test_unchanged|s{qqqqqrN)rLr=rMrrrrr;rrrr[sFE


rrc*eZdZdZdZdZdZdZdS)Test_reducereducec:d}d}|||dS)Nzreduce(a, b, c)z,from functools import reduce
reduce(a, b, c)rRrSs   rtest_simple_callzTest_reduce.test_simple_calls&;

1arc:d}d}|||dS)Nzdef x(arg): reduce(sum, [])z8from functools import reduce
def x(arg): reduce(sum, [])rRrSs   r
test_bug_7253zTest_reduce.test_bug_7253s&)G

1arc:d}d}|||dS)Nzreduce(lambda x, y: x + y, seq)z<from functools import reduce
reduce(lambda x, y: x + y, seq)rRrSs   rtest_call_with_lambdaz!Test_reduce.test_call_with_lambdas&-K

1arcd}||d}||d}||d}||d}||dS)Nz	reduce(a)zreduce(a, b=42)zreduce(a, b, c, d)zreduce(**c)zreduce()r2rs  rrzTest_reduce.test_unchangeds{qq qqqrN)rLr=rMrrrrrr;rrrrsUE

rrcxeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdS)
Test_printprintc:d}d}|||dS)Nzprint 1,   1+1,   1+1+1zprint(1,   1+1,   1+1+1)rRrSs   rrz#Test_print.test_prefix_preservations&)*

1arcbd}||d}||dS)Nprint()	print('')r2rs  rtest_idempotencyzTest_print.test_idempotencys6qqrctj|jj_d}||d}||d}||dS)Nprint(1, 1+1, 1+1+1)rr)r!python_grammar_no_print_statementrdrivergrammarr/rs  r"test_idempotency_print_as_functionz-Test_print.test_idempotency_print_as_functions]'-'O
$&qqqrc:d}d}|||dS)Nzprint 1, 1+1, 1+1+1rrRrSs   rr`zTest_print.test_1s&%&

1arc:d}d}|||dS)Nz
print 1, 2zprint(1, 2)rRrSs   rrbzTest_print.test_2s&

1arc:d}d}|||dS)NrrrRrSs   rrezTest_print.test_3s&

1arc:d}d}|||dS)Nzprint whatever; printzprint(whatever); print()rRrSs   rrgzTest_print.test_4s&'*

1arc:d}d}|||dS)Nzprint; print whatever;zprint(); print(whatever);rRrSs   rrizTest_print.test_5s&(+

1arc:d}d}|||dS)Nzprint (a, b, c)zprint((a, b, c))rRrSs   r
test_tuplezTest_print.test_tuples&!"

1arc:d}d}|||dS)Nzprint 1, 2, 3,zprint(1, 2, 3, end=' ')rRrSs   rtest_trailing_comma_1z Test_print.test_trailing_comma_1s& )

1arc:d}d}|||dS)Nzprint 1, 2,zprint(1, 2, end=' ')rRrSs   rtest_trailing_comma_2z Test_print.test_trailing_comma_2s&&

1arc:d}d}|||dS)Nzprint 1,zprint(1, end=' ')rRrSs   rtest_trailing_comma_3z Test_print.test_trailing_comma_3s&#

1arc:d}d}|||dS)Nzprint >>sys.stderr, 1, 2, 3zprint(1, 2, 3, file=sys.stderr)rRrSs   r!test_vargs_without_trailing_commaz,Test_print.test_vargs_without_trailing_commas&-1

1arc:d}d}|||dS)Nzprint >>sys.stderr, 1, 2,z%print(1, 2, end=' ', file=sys.stderr)rRrSs   rtest_with_trailing_commaz#Test_print.test_with_trailing_commas&+7

1arc:d}d}|||dS)Nzprint >>sys.stderr, 1+1zprint(1+1, file=sys.stderr)rRrSs   rtest_no_trailing_commaz!Test_print.test_no_trailing_commas&)-

1arc:d}d}|||dS)Nzprint >>  sys.stderrzprint(file=sys.stderr)rRrSs   rtest_spaces_before_filez"Test_print.test_spaces_before_file
s&&(

1archd}||d}d}|||dS)Nz<from __future__ import print_function
print('Hai!', end=' ')zprint 'Hello, world!'zprint('Hello, world!')r/r))rrrTrUs    rtest_with_future_print_functionz*Test_print.test_with_future_print_functions?
%q#$

1arN)rLr=rMrrrrr`rbrergrirrrrrrrrrr;rrrrsE
			









rrcNeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dS)
	Test_execexecc:d}d}|||dS)Nz  exec code in ns1,   ns2z  exec(code, ns1,   ns2)rRrSs   rrz"Test_exec.test_prefix_preservations&+*

1arc:d}d}|||dS)Nz	exec code
exec(code)rRrSs   rrVzTest_exec.test_basic!s&

1arc:d}d}|||dS)Nzexec code in nsexec(code, ns)rRrSs   rtest_with_globalszTest_exec.test_with_globals&s&! 

1arc:d}d}|||dS)Nzexec code in ns1, ns2exec(code, ns1, ns2)rRrSs   rtest_with_globals_localsz"Test_exec.test_with_globals_locals+s&'&

1arc:d}d}|||dS)Nzexec (a.b()) in nszexec((a.b()), ns)rRrSs   rrzTest_exec.test_complex_10&$#

1arc:d}d}|||dS)Nzexec a.b() + c in nszexec(a.b() + c, ns)rRrSs   rrzTest_exec.test_complex_25&&%

1arc4d}||dS)Nrr2rs  rrzTest_exec.test_unchanged_1<qrc4d}||dS)Nzexec (code)r2rs  rrzTest_exec.test_unchanged_2@sqrc4d}||dS)Nrr2rs  rrzTest_exec.test_unchanged_3D qrc4d}||dS)Nrr2rs  rrzTest_exec.test_unchanged_4Hs&qrN)rLr=rMrrrVrrrrrrrrr;rrrrsE




rrc<eZdZdZdZdZdZdZdZdZ	dZ
d	S)
	Test_reprreprc:d}d}|||dS)Nz
x =   `1 + 2`zx =   repr(1 + 2)rRrSs   rrz"Test_repr.test_prefix_preservationO&#

1arc:d}d}|||dS)Nzx = `1 + 2`zx = repr(1 + 2)rRrSs   r
test_simple_1zTest_repr.test_simple_1Ts&!

1arc:d}d}|||dS)Nzy = `x`zy = repr(x)rRrSs   r
test_simple_2zTest_repr.test_simple_2Ys&

1arc:d}d}|||dS)Nzz = `y`.__repr__()zz = repr(y).__repr__()rRrSs   rtest_complexzTest_repr.test_complex^s&$(

1arc:d}d}|||dS)Nz
x = `1, 2, 3`zx = repr((1, 2, 3))rRrSs   rrzTest_repr.test_tuplec&%

1arc:d}d}|||dS)Nz
x = `1 + `2``zx = repr(1 + repr(2))rRrSs   rtest_nestedzTest_repr.test_nestedhs&'

1arc:d}d}|||dS)Nzx = `1, 2 + `3, 4``zx = repr((1, 2 + repr((3, 4))))rRrSs   rtest_nested_tupleszTest_repr.test_nested_tuplesms&%1

1arN)rLr=rMrrrrrrrrr;rrrrLsE





rrcreZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdS)Test_exceptexceptc:d}d}|||dS)Nzq
            try:
                pass
            except (RuntimeError, ImportError),    e:
                passzs
            try:
                pass
            except (RuntimeError, ImportError) as    e:
                passrRrSs   rrz$Test_except.test_prefix_preservationu,



	

1arc:d}d}|||dS)NzV
            try:
                pass
            except Foo, e:
                passX
            try:
                pass
            except Foo as e:
                passrRrSs   rtest_simplezTest_except.test_simpler#rc:d}d}|||dS)NzU
            try:
                pass
            except Foo,e:
                passr%rRrSs   r"test_simple_no_space_before_targetz.Test_except.test_simple_no_space_before_targetr#rc:d}d}|||dS)Nz
            def foo():
                try:
                    pass
                except Exception, (f, e):
                    pass
                except ImportError, e:
                    passa
            def foo():
                try:
                    pass
                except Exception as xxx_todo_changeme:
                    (f, e) = xxx_todo_changeme.args
                    pass
                except ImportError as e:
                    passrRrSs   rtest_tuple_unpackzTest_except.test_tuple_unpacks,

	

1arc:d}d}|||dS)Nzn
            try:
                pass
            except (RuntimeError, ImportError), e:
                passzp
            try:
                pass
            except (RuntimeError, ImportError) as e:
                passrRrSs   rtest_multi_classzTest_except.test_multi_classs,


	

1arc:d}d}|||dS)Nza
            try:
                pass
            except Exception, [a, b]:
                passz
            try:
                pass
            except Exception as xxx_todo_changeme:
                [a, b] = xxx_todo_changeme.args
                passrRrSs   rtest_list_unpackzTest_except.test_list_unpack,

	

1arc:d}d}|||dS)Nz_
            try:
                pass
            except Exception, d[5]:
                passz
            try:
                pass
            except Exception as xxx_todo_changeme:
                d[5] = xxx_todo_changeme
                passrRrSs   rtest_weird_target_1zTest_except.test_weird_target_1r/rc:d}d}|||dS)Nz`
            try:
                pass
            except Exception, a.foo:
                passz
            try:
                pass
            except Exception as xxx_todo_changeme:
                a.foo = xxx_todo_changeme
                passrRrSs   rtest_weird_target_2zTest_except.test_weird_target_2r/rc:d}d}|||dS)Nzb
            try:
                pass
            except Exception, a().foo:
                passz
            try:
                pass
            except Exception as xxx_todo_changeme:
                a().foo = xxx_todo_changeme
                passrRrSs   rtest_weird_target_3zTest_except.test_weird_target_3r/rc:d}d}|||dS)Nz
            try:
                pass
            except Exception, a:
                pass
            except:
                passz
            try:
                pass
            except Exception as a:
                pass
            except:
                passrRrSs   rtest_bare_exceptzTest_except.test_bare_excepts,

	

1arc:d}d}|||dS)Nz
            try:
                pass
            except Exception, a:
                pass
            except:
                pass
            else:
                pass
            finally:
                passz
            try:
                pass
            except Exception as a:
                pass
            except:
                pass
            else:
                pass
            finally:
                passrRrSs   r!test_bare_except_and_else_finallyz-Test_except.test_bare_except_and_else_finally
s,



	

1arc:d}d}|||dS)Nz
            try:
                pass
            except TypeError, b:
                pass
            except Exception, a:
                pass
            except:
                passz
            try:
                pass
            except TypeError as b:
                pass
            except Exception as a:
                pass
            except:
                passrRrSs   r+test_multi_fixed_excepts_before_bare_exceptz7Test_except.test_multi_fixed_excepts_before_bare_except's,

	

1arcd}d}|||d}d}|||d}d}|||d}d}|||dS)	Nzd
            try: raise TypeError
            except TypeError, e:
                pass
            zf
            try: raise TypeError
            except TypeError as e:
                pass
            zd
            try:
                raise TypeError
            except TypeError, e: pass
            zf
            try:
                raise TypeError
            except TypeError as e: pass
            zT
            try: raise TypeError
            except TypeError, e: pass
            zV
            try: raise TypeError
            except TypeError as e: pass
            z
            try: raise TypeError
            except TypeError, e: pass
            else: function()
            finally: done()
            z
            try: raise TypeError
            except TypeError as e: pass
            else: function()
            finally: done()
            rRrSs   rtest_one_line_suitesz Test_except.test_one_line_suites=s



	

1a



	

1a

	

1a

	

1arc4d}||dS)NzO
            try:
                pass
            except:
                passr2rs  rrzTest_except.test_unchanged_1m#

	
qrc4d}||dS)NzY
            try:
                pass
            except Exception:
                passr2rs  rrzTest_except.test_unchanged_2ur?rc4d}||dS)Nzg
            try:
                pass
            except (Exception, SystemExit):
                passr2rs  rrzTest_except.test_unchanged_3}r?rN)rLr=rMrrr&r(r*r,r.r1r3r5r7r9r;r=rrrr;rrr r rs
E*











$4,,,,`rr cxeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdS)
Test_raiseraisec:d}d}|||dS)Nzraise Exception, 5raise Exception(5)rRrSs   rrVzTest_raise.test_basics&$$

1arcnd}d}|||d}d}|||dS)Nzraise Exception,5rFzraise   Exception,    5zraise   Exception(5)rRrSs   rrz#Test_raise.test_prefix_preservationsD#$

1a)&

1arcd}d}|||d}d}|||d}d}|||dS)Nzraise Exception, 5 # foozraise Exception(5) # foozraise E, (5, 6) % (a, b) # foozraise E((5, 6) % (a, b)) # fooz:def foo():
                    raise Exception, 5, 6 # foozIdef foo():
                    raise Exception(5).with_traceback(6) # foorRrSs   rtest_with_commentszTest_raise.test_with_commentssg**

1a00

1a
3
B

1arc:d}d}|||dS)Nzraise Exception(5), None, tbz%raise Exception(5).with_traceback(tb)rRrSs   rtest_None_valuezTest_raise.test_None_values&.7

1arc:d}d}|||dS)Nzraise Exception, (5, 6, 7)zraise Exception(5, 6, 7)rRrSs   rtest_tuple_valuezTest_raise.test_tuple_values&,*

1arc:d}d}|||dS)Nzraise E, (5, 6) % (a, b)zraise E((5, 6) % (a, b))rRrSs   rtest_tuple_detectionzTest_raise.test_tuple_detections&**

1arc:d}d}|||dS)Nzraise (((E1, E2), E3), E4), Vraise E1(V)rRrSs   rtest_tuple_exc_1zTest_raise.test_tuple_exc_1s&/

1arc:d}d}|||dS)Nzraise (E1, (E2, E3), E4), VrQrRrSs   rtest_tuple_exc_2zTest_raise.test_tuple_exc_2s&-

1arc6d}||ddS)Nzraise 'foo'+Python 3 does not support string exceptionsr4rs  rtest_string_exczTest_raise.test_string_excs$Q MNNNNNrc6d}||ddS)Nzraise "foo", 5rVrWrs  rtest_string_exc_valzTest_raise.test_string_exc_val$ Q MNNNNNrc6d}||ddS)Nzraise "foo", 5, 6rVrWrs  rtest_string_exc_val_tbz!Test_raise.test_string_exc_val_tb$#Q MNNNNNrc:d}d}|||dS)Nz4def foo():
                    raise Exception, 5, 6Cdef foo():
                    raise Exception(5).with_traceback(6)rRrSs   r	test_tb_1zTest_raise.test_tb_1s*
-
<

1arc:d}d}|||dS)Nzhdef foo():
                    a = 5
                    raise Exception, 5, 6
                    b = 6wdef foo():
                    a = 5
                    raise Exception(5).with_traceback(6)
                    b = 6rRrSs   r	test_tb_2zTest_raise.test_tb_2,

	

1arc:d}d}|||dS)Nz2def foo():
                    raise Exception,5,6r`rRrSs   r	test_tb_3zTest_raise.test_tb_3s*
+
<

1arc:d}d}|||dS)Nzfdef foo():
                    a = 5
                    raise Exception,5,6
                    b = 6rcrRrSs   r	test_tb_4zTest_raise.test_tb_4rerc:d}d}|||dS)Nz<def foo():
                    raise Exception, (5, 6, 7), 6zIdef foo():
                    raise Exception(5, 6, 7).with_traceback(6)rRrSs   r	test_tb_5zTest_raise.test_tb_5s+
5
B

1arc:d}d}|||dS)Nzpdef foo():
                    a = 5
                    raise Exception, (5, 6, 7), 6
                    b = 6z}def foo():
                    a = 5
                    raise Exception(5, 6, 7).with_traceback(6)
                    b = 6rRrSs   r	test_tb_6zTest_raise.test_tb_6rerN)rLr=rMrrVrrIrKrMrOrRrTrXrZr]rardrgrirkrmr;rrrCrCs!E







OOOOOOOOO											rrCc~eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdS)
Test_throwthrowc:d}d}|||dS)Nzg.throw(Exception, 5)g.throw(Exception(5))rRrSs   rr`zTest_throw.test_1s&''

1arc:d}d}|||dS)Nzg.throw(Exception,5)rrrRrSs   rrbzTest_throw.test_2s&&'

1arc:d}d}|||dS)Nzg.throw(Exception, (5, 6, 7))zg.throw(Exception(5, 6, 7))rRrSs   rrezTest_throw.test_3s&/-

1arc:d}d}|||dS)Nz5 + g.throw(Exception, 5)z5 + g.throw(Exception(5))rRrSs   rrgzTest_throw.test_4s&++

1arc6d}||ddS)Nzg.throw("foo")rVrWrs  rtest_warn_1zTest_throw.test_warn_1r[rc6d}||ddS)Nzg.throw("foo", 5)rVrWrs  rtest_warn_2zTest_throw.test_warn_2!r^rc6d}||ddS)Nzg.throw("foo", 5, 6)rVrWrs  rtest_warn_3zTest_throw.test_warn_3%s$&Q MNNNNNrc4d}||dS)Nzg.throw(Exception)r2rs  rtest_untouched_1zTest_throw.test_untouched_1+$qrc4d}||dS)Nzg.throw(Exception(5, 6))r2rs  rtest_untouched_2zTest_throw.test_untouched_2/s*qrc4d}||dS)Nz5 + g.throw(Exception(5, 6))r2rs  rtest_untouched_3zTest_throw.test_untouched_33rrc:d}d}|||dS)Nz7def foo():
                    g.throw(Exception, 5, 6)Fdef foo():
                    g.throw(Exception(5).with_traceback(6))rRrSs   rrazTest_throw.test_tb_19s*
0
?

1arc:d}d}|||dS)Nzkdef foo():
                    a = 5
                    g.throw(Exception, 5, 6)
                    b = 6zdef foo():
                    a = 5
                    g.throw(Exception(5).with_traceback(6))
                    b = 6rRrSs   rrdzTest_throw.test_tb_2@rerc:d}d}|||dS)Nz5def foo():
                    g.throw(Exception,5,6)rrRrSs   rrgzTest_throw.test_tb_3Ks*
.
?

1arc:d}d}|||dS)Nzidef foo():
                    a = 5
                    g.throw(Exception,5,6)
                    b = 6rrRrSs   rrizTest_throw.test_tb_4Rrerc:d}d}|||dS)Nz?def foo():
                    g.throw(Exception, (5, 6, 7), 6)zLdef foo():
                    g.throw(Exception(5, 6, 7).with_traceback(6))rRrSs   rrkzTest_throw.test_tb_5]s+
8
E

1arc:d}d}|||dS)Nzsdef foo():
                    a = 5
                    g.throw(Exception, (5, 6, 7), 6)
                    b = 6zdef foo():
                    a = 5
                    g.throw(Exception(5, 6, 7).with_traceback(6))
                    b = 6rRrSs   rrmzTest_throw.test_tb_6drerc:d}d}|||dS)Nz;def foo():
                    a + g.throw(Exception, 5, 6)zJdef foo():
                    a + g.throw(Exception(5).with_traceback(6))rRrSs   r	test_tb_7zTest_throw.test_tb_7os+
4
C

1arc:d}d}|||dS)Nzodef foo():
                    a = 5
                    a + g.throw(Exception, 5, 6)
                    b = 6z~def foo():
                    a = 5
                    a + g.throw(Exception(5).with_traceback(6))
                    b = 6rRrSs   r	test_tb_8zTest_throw.test_tb_8vrerN)rLr=rMrr`rbrergrwryr{r}rrrardrgrirkrmrrr;rrroros0E


OOOOOOOOO														rroc0eZdZdZdZdZdZdZdZdS)	Test_longlongc:d}d}|||dS)Nzx = long(x)z
x = int(x)rRrSs   rr`zTest_long.test_1s&

1arc:d}d}|||dS)Nzy = isinstance(x, long)zy = isinstance(x, int)rRrSs   rrbzTest_long.test_2&)(

1arc:d}d}|||dS)Nzz = type(x) in (int, long)zz = type(x) in (int, int)rRrSs   rrezTest_long.test_3s&,+

1arcHd}||d}||d}||d}||d}||d}||d}||dS)Nzlong = Truez
s.long = Truezdef long(): passzclass long(): passzdef f(long): passzdef f(g, long): passzdef f(x, long=True): passr2rs  rrzTest_long.test_unchangedsqq"q$q#q&q+qrc:d}d}|||dS)Nzx =   long(  x  )zx =   int(  x  )rRrSs   rrz"Test_long.test_prefix_preservation&#"

1arN)	rLr=rMrr`rbrerrr;rrrrsdE


,rrceZdZdZdZdZdS)
Test_execfileexecfilec>d}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||d}d}|||dS)
Nzexecfile("fn")z4exec(compile(open("fn", "rb").read(), "fn", 'exec'))zexecfile("fn", glob)z:exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob)zexecfile("fn", glob, loc)z?exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob, loc)zexecfile("fn", globals=glob)zBexec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob)zexecfile("fn", locals=loc)z@exec(compile(open("fn", "rb").read(), "fn", 'exec'), locals=loc)z(execfile("fn", globals=glob, locals=loc)zNexec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob, locals=loc)rRrSs   rtest_conversionzTest_execfile.test_conversions F

1a&L

1a+Q

1a.T

1a,R

1a:`

1arcnd}d}|||d}d}|||dS)Nzexecfile( "fn" )z6exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))zexecfile("fn",  globals = glob)zEexec(compile(open("fn", "rb").read(), "fn", 'exec'),  globals = glob)rRrSs   rtest_spacingzTest_execfile.test_spacingsD"H

1a1W

1arN)rLr=rMrrrr;rrrrs7E2rrc$eZdZdZdZdZdZdS)Test_isinstance
isinstancecd}d}|||d}d}|||d}d}|||d}d}|||dS)	Nzisinstance(x, (int, int, int))zisinstance(x, int)z,isinstance(x, (int, float, int, int, float))zisinstance(x, (int, float))z1isinstance(x, (int, float, int, int, float, str))z isinstance(x, (int, float, str))z4isinstance(foo() + bar(), (x(), y(), x(), int, int))z/isinstance(foo() + bar(), (x(), y(), x(), int))rRrSs   rtest_remove_multiple_itemsz*Test_isinstance.test_remove_multiple_itemss0$

1a>-

1aC2

1aFA

1arc:d}d}|||dS)Nz4if    isinstance(  foo(), (  bar, bar, baz )) : passz/if    isinstance(  foo(), (  bar, baz )) : passrRrSs   rrz(Test_isinstance.test_prefix_preservations&FA

1arc0|ddS)Nzisinstance(x, (str, int))r2rs rrzTest_isinstance.test_unchangeds233333rN)rLr=rMrrrrr;rrrrsFE"
44444rrceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%S)&	Test_dictdictc>d}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||d}d}|||dS)Nzif   d. keys  (  )  : passz if   list(d. keys  (  ))  : passzif   d. items  (  )  : passz!if   list(d. items  (  ))  : passzif   d. iterkeys  ( )  : passzif   iter(d. keys  ( ))  : passz"[i for i in    d.  iterkeys(  )  ]z[i for i in    d.  keys(  )  ]zif   d. viewkeys  ( )  : passzif   d. keys  ( )  : passz"[i for i in    d.  viewkeys(  )  ]rRrSs   rrz"Test_dict.test_prefix_preservations(.

1a)/

1a+-

1a0,

1a+'

1a0,

1arc>d}d}|||d}d}|||d}d}|||d}d}|||d}d}|||d	}d}|||dS)
Nzd.keys() # foozlist(d.keys()) # foozd.items()  # foozlist(d.items())  # foozd.iterkeys()  # fooziter(d.keys())  # fooz/[i for i in d.iterkeys() # foo
               ]z+[i for i in d.keys() # foo
               ]zd.viewitems()  # foorRrSs   rtest_trailing_commentzTest_dict.test_trailing_comment
s"

1a$

1a!#

1a



1a



1a"

1arctjD]P}d|z}||d|z}||d|z}||QdS)Nzs = %s(d.keys())zs = %s(d.values())zs = %s(d.items())rconsuming_callsr/)rwrapperrs   rrzTest_dict.test_unchanged*su!1		G"W,ANN1$w.ANN1#g-ANN1		rcnd}d}|||d}d}|||dS)Nd.keys()list(d.keys())za[0].foo().keys()zlist(a[0].foo().keys())rRrSs   rtest_01zTest_dict.test_015sD

1a%

1arc:d}d}|||dS)N	d.items()zlist(d.items())rRrSs   rtest_02zTest_dict.test_02>s&

1arc:d}d}|||dS)N
d.values()zlist(d.values())rRrSs   rtest_03zTest_dict.test_03Cs&

1arc:d}d}|||dS)Nzd.iterkeys()iter(d.keys())rRrSs   rtest_04zTest_dict.test_04Hs&

1arc:d}d}|||dS)Nz
d.iteritems()ziter(d.items())rRrSs   rtest_05zTest_dict.test_05Ms&

1arc:d}d}|||dS)Nzd.itervalues()ziter(d.values())rRrSs   rtest_06zTest_dict.test_06Rs&

1arc4d}||dS)Nrr2rs  rtest_07zTest_dict.test_07Wr	rc4d}||dS)Nsorted(d.keys())r2rs  rtest_08zTest_dict.test_08[sqrc:d}d}|||dS)Nrziter(list(d.keys()))rRrSs   rtest_09zTest_dict.test_09_s&"

1arc:d}d}|||dS)Nz
foo(d.keys())zfoo(list(d.keys()))rRrSs   rrvzTest_dict.test_10ds&!

1arc:d}d}|||dS)Nfor i in d.keys(): print iz for i in list(d.keys()): print irRrSs   rrxzTest_dict.test_11is&(.

1arc:d}d}|||dS)Nzfor i in d.iterkeys(): print irrRrSs   rtest_12zTest_dict.test_12ns&,(

1arc:d}d}|||dS)N[i for i in d.keys()]z for i in list(d.keys())]rRrSs   rtest_13zTest_dict.test_13s&#)

1arc:d}d}|||dS)Nz[i for i in d.iterkeys()]rrRrSs   rtest_14zTest_dict.test_14xrjrc:d}d}|||dS)N(i for i in d.keys())z(i for i in list(d.keys()))rRrSs   rtest_15zTest_dict.test_15}rrc:d}d}|||dS)Nz(i for i in d.iterkeys())rrRrSs   rtest_16zTest_dict.test_16rjrc:d}d}|||dS)Nziter(d.iterkeys())rrRrSs   rtest_17zTest_dict.test_17& 

1arc:d}d}|||dS)Nzlist(d.iterkeys())rrRrSs   rtest_18zTest_dict.test_18rrc:d}d}|||dS)Nzsorted(d.iterkeys())rrRrSs   rtest_19zTest_dict.test_19&"

1arc:d}d}|||dS)Nzfoo(d.iterkeys())zfoo(iter(d.keys()))rRrSs   rtest_20zTest_dict.test_20s&!

1arc:d}d}|||dS)Nzprint h.iterkeys().next()zprint iter(h.keys()).next()rRrSs   rtest_21zTest_dict.test_21s&')

1arc:d}d}|||dS)Nzprint h.keys()[0]zprint list(h.keys())[0]rRrSs   rtest_22zTest_dict.test_22rrc:d}d}|||dS)Nzprint list(h.iterkeys().next())z!print list(iter(h.keys()).next())rRrSs   rtest_23zTest_dict.test_23s&-/

1arc:d}d}|||dS)Nzfor x in h.keys()[0]: print xz#for x in list(h.keys())[0]: print xrRrSs   rtest_24zTest_dict.test_24s&+1

1arc:d}d}|||dS)Nzd.viewkeys()rrRrSs   rtest_25zTest_dict.test_25s&

1arc:d}d}|||dS)Nz
d.viewitems()rrRrSs   rtest_26zTest_dict.test_26s&

1arc:d}d}|||dS)Nzd.viewvalues()rrRrSs   rtest_27zTest_dict.test_27s&

1arc:d}d}|||dS)Nz[i for i in d.viewkeys()]rrRrSs   rtest_28zTest_dict.test_28rjrc:d}d}|||dS)Nz(i for i in d.viewkeys())rrRrSs   rtest_29zTest_dict.test_29rjrc:d}d}|||dS)Nziter(d.viewkeys())rrRrSs   rtest_30zTest_dict.test_30rrc:d}d}|||dS)Nzlist(d.viewkeys())rrRrSs   rtest_31zTest_dict.test_31rrc:d}d}|||dS)Nzsorted(d.viewkeys())rrRrSs   rtest_32zTest_dict.test_32rrN)'rLr=rMrrrrrrrrrrrrrrvrxrrrrrrrrrrrrrrrrrrrrrr;rrrrs&E2:			



























rrcHeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdS)Test_xrangexrangecd}d}|||d}d}|||d}d}|||dS)Nzx =    xrange(  10  )zx =    range(  10  )zx = xrange(  1  ,  10   )zx = range(  1  ,  10   )zx = xrange(  0  ,  10 ,  2 )zx = range(  0  ,  10 ,  2 )rRrSs   rrz$Test_xrange.test_prefix_preservationsb'&

1a+*

1a.-

1arc:d}d}|||dS)Nzx = xrange(10)z
x = range(10)rRrSs   rtest_single_argzTest_xrange.test_single_arg& 

1arc:d}d}|||dS)Nzx = xrange(1, 10)zx = range(1, 10)rRrSs   r
test_two_argszTest_xrange.test_two_argsrrc:d}d}|||dS)Nzx = xrange(0, 10, 2)zx = range(0, 10, 2)rRrSs   rtest_three_argszTest_xrange.test_three_argsrrc
d}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||dS)Nzx = range(10, 3, 9)zx = list(range(10, 3, 9))zx = foo(range(10, 3, 9))zx = foo(list(range(10, 3, 9)))zx = range(10, 3, 9) + [4]zx = list(range(10, 3, 9)) + [4]zx = range(10)[::-1]zx = list(range(10))[::-1]zx = range(10)  [3]zx = list(range(10))  [3]rRrSs   rtest_wrap_in_listzTest_xrange.test_wrap_in_lists%+

1a*0

1a+1

1a%+

1a$*

1arcnd}d}|||d}d}|||dS)Nzfor i in xrange(10):
    j=izfor i in range(10):
    j=iz[i for i in xrange(10)][i for i in range(10)]rRrSs   rtest_xrange_in_forzTest_xrange.test_xrange_in_forsD/.

1a)(

1arcZ|d|ddS)Nzfor i in range(10): passr
r2rs rtest_range_in_forzTest_xrange.test_range_in_fors.1222/00000rc0|ddS)Nzx in range(10, 3, 9)r2rs rtest_in_contains_testz!Test_xrange.test_in_contains_tests-.....rcTtjD]}|d|zdS)Nza = %s(range(10))r)rcalls  rtest_in_consuming_contextz%Test_xrange.test_in_consuming_contexts9.	7	7DNN.56666	7	7rN)
rLr=rMrrrrrrrr
rrr;rrrrsE


*111///77777rrc$eZdZfdZdZxZS)Test_xrange_with_reducec\tt|ddgdS)Nrr)superrr)rr<s rrzTest_xrange_with_reduce.setUp!s-
%t,,22Hh3GHHHHHrc:d}d}|||dS)Nzreduce(x, xrange(5))z0from functools import reduce
reduce(x, range(5))rRrSs   rtest_double_transformz-Test_xrange_with_reduce.test_double_transform$s(&


1ar)rLr=rMrr
__classcell__r<s@rrrsLIIIIIrrcBeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
S)Test_raw_input	raw_inputcnd}d}|||d}d}|||dS)Nzx =    raw_input(   )zx =    input(   )zx = raw_input(   ''   )x = input(   ''   )rRrSs   rrz'Test_raw_input.test_prefix_preservation-sD'#

1a)%

1arc:d}d}|||dS)Nzx = raw_input()x = input()rRrSs   rr`zTest_raw_input.test_16s&!

1arc:d}d}|||dS)Nzx = raw_input('')
x = input('')rRrSs   rrbzTest_raw_input.test_2;s&#

1arc:d}d}|||dS)Nzx = raw_input('prompt')x = input('prompt')rRrSs   rrezTest_raw_input.test_3@s&)%

1arc:d}d}|||dS)Nzx = raw_input(foo(a) + 6)zx = input(foo(a) + 6)rRrSs   rrgzTest_raw_input.test_4Erprc:d}d}|||dS)Nzx = raw_input(invite).split()zx = input(invite).split()rRrSs   rrizTest_raw_input.test_5Jrcrc:d}d}|||dS)Nz x = raw_input(invite) . split ()zx = input(invite) . split ()rRrSs   rrlzTest_raw_input.test_6Orrc:d}d}|||dS)Nzx = int(raw_input())zx = int(input())rRrSs   rrrzTest_raw_input.test_8TrrN)rLr=rMrrr`rbrergrirlrrr;rrrr*sE





rrc&eZdZdZgdZdZdZdS)Test_funcattrs	funcattrs)closuredocnamedefaultscodeglobalsrc|jD]B}d|z}d|z}|||d|z}d|z}|||CdS)Nz	a.func_%sa.__%s__zself.foo.func_%s.foo_barself.foo.__%s__.foo_barattrsr)rattrrTrUs    rrzTest_funcattrs.test^spJ		Dd"AT!AJJq!*T1A)D0AJJq!		rc|jD]P}d|z}||d|z}||d|z}||QdS)Nzfoo(func_%s + 5)
f(foo.__%s__)f(foo.__%s__.foo)r7r/rr9rs   rrzTest_funcattrs.test_unchangedhstJ		D"T)ANN1$&ANN1#d*ANN1		rNrLr=rMrr7rrr;rrr+r+YsBEMMME					rr+c$eZdZdZdZdZdZdS)Test_xreadlines
xreadlinescd}d}|||d}d}|||d}d}|||dS)Nzfor x in f.xreadlines(): passzfor x in f: passz!for x in foo().xreadlines(): passzfor x in foo(): passz'for x in (5 + foo()).xreadlines(): passzfor x in (5 + foo()): passrRrSs   rrzTest_xreadlines.test_callvsb+

1a/"

1a5(

1arcd}d}|||d}d}|||d}d}|||dS)Nzfoo(f.xreadlines + 5)zfoo(f.__iter__ + 5)zfoo(f().xreadlines + 5)zfoo(f().__iter__ + 5)zfoo((5 + f()).xreadlines + 5)zfoo((5 + f()).__iter__ + 5)rRrSs   r
test_attr_refzTest_xreadlines.test_attr_refsb#!

1a%#

1a+)

1arcd}||d}||d}||d}||dS)Nzfor x in f.xreadlines(5): passz for x in f.xreadlines(k=5): passz$for x in f.xreadlines(*k, **v): passzfoo(xreadlines)r2rs  rrzTest_xreadlines.test_unchangedsd,q.q2qqrN)rLr=rMrrrErr;rrrArAssFErrAc2eZdZdZdZdZdZdZdZdS)ImportsFixerTestsc|jD]E\}}d|z}d|z}|||d|z}d|z}|||FdS)N	import %szimport foo, %s, barmodulesitemsr)roldnewrTrUs     rtest_import_modulez$ImportsFixerTests.test_import_modules**,,		HCc!Ac!AJJq!%+A%+AJJq!		rc|jD]e\}}d|z}d|z}|||d|z}d|z}|||d|z}d|z}|||fdS)Nzfrom %s import foozfrom %s import foo, barzfrom %s import (yes, no)rKrNs     rtest_import_fromz"ImportsFixerTests.test_import_froms**,,		HC$s*A$s*AJJq!)C/A)C/AJJq!*S0A*S0AJJq!		rc|jD]E\}}d|z}d|z}|||d|z}d|z}|||FdS)Nzimport %s as foo_barrKrNs     rtest_import_module_asz'ImportsFixerTests.test_import_module_ass**,,		HC&,A&,AJJq!&,A&,AJJq!		rc|jD]%\}}d|z}d|z}|||&dS)Nzfrom %s import foo as barrKrNs     rtest_import_from_asz%ImportsFixerTests.test_import_from_assX**,,		HC+c1A+c1AJJq!		rc|jD]%\}}d|z}d|z}|||&dS)Nfrom %s import *rKrNs     r	test_starzImportsFixerTests.test_starsX**,,		HC"S(A"S(AJJq!		rc|jD]\}}d|d|d}d|d|d}|||d|d|d}d|d|d}|||d|d}||d|d	|d
|d}d|d	|d
|d}|||d|d|d	}d|d|d	}|||dS)
N
                import 
                foo(z.bar)
                
                from z import x
                z = 23
                z.
                def f():
                    z.method()
                z
                z.bar(z.foo)
                z
                x.)rLrMr)r/)rrOrPrTrUrs      rtest_import_module_usagez*ImportsFixerTests.test_import_module_usages**,,.	.	HCssCCC!AAssCCC!A
JJq!
ssCCC!AAssCCC!A
JJq!
ssA
NN1ssCCC&AAssCCC&A
JJq!
ssCCC!AAssCCC!A
JJq!].	.	rN)	rLr=rMrQrSrUrWrZr_r;rrrHrHsn/////rrHc*eZdZdZddlmZdZdZdS)Test_importsimportsMAPPINGc:d}d}|||dS)Nzimport urlparse, cStringIOzimport urllib.parse, iorRrSs   rtest_multiple_importsz"Test_imports.test_multiple_importss&,)

1arc:d}d}|||dS)Nzv
            import copy_reg as bar, HTMLParser as foo, urlparse
            s = urlparse.spam(bar.foo())
            z~
            import copyreg as bar, html.parser as foo, urllib.parse
            s = urllib.parse.spam(bar.foo())
            rRrSs   rtest_multiple_imports_asz%Test_imports.test_multiple_imports_as	,

	

1arN)	rLr=rMrfixes.fix_importsrerLrgrir;rrrarasIE666666
					rraceZdZdZddlmZdS)
Test_imports2imports2rcrdN)rLr=rMrfixes.fix_imports2rerLr;rrrmrms'E77777777rrmc$eZdZfdZdZxZS)Test_imports_fixer_orderctt|ddgddlm}||_ddlm}dD]}|||j|<dS)Nrbrnrcrd)dbhashdumbdbmdbmgdbm)rrqrrorecopyrLrk)rmapping2mapping1keyr<s    rrzTest_imports_fixer_order.setUps
&--33Y
4KLLL<<<<<<}};;;;;;7	.	.C (
DL	.	.rcHdD]}||_|ddS)N)rbrnimport)rrK)rfixs  r$test_after_local_imports_refactoringz=Test_imports_fixer_order.test_after_local_imports_refactoring$s9*	-	-CDJ""8,,,,	-	-r)rLr=rMrr~rrs@rrqrqsG.....-------rrqcNeZdZdZddlmZdZdZdZ	dZ
dZd	Zd
Z
dZdS)
Test_urlliburllibrcrdc	|jD]S\}}d|z}ddtt	d|z}|||TdS)NrJr9r)rLrMr-maprr))rrOchangesrTrUs     rrQzTest_urllib.test_import_module.st L..00		LCc!AdiiJqMM7(C(CDDDAJJq!		rc|jD]3\}}g}|D]\}}|D]W}||d|d|}d|d|}|||d|z}	||	Xd|dd|}d|dd|}|||dd|z}	||	d|dd|}dd|D}|||5dS)Nfrom  import from foo import %sr9
cJg|] \}}d|dd|!S)rrr9)r-)r>rPmemberss   rr@z0Test_urllib.test_import_from.<locals>.<listcomp>JsF;;; .gg36##tyy7I7I7IJ;;;r)rLrMappendr)r/r-)
rrOrall_membersrPrmemberrTrUrs
          rrSzTest_urllib.test_import_from4s L..00		LCK '
"
"W%&&F&&v..../2ssFF;AA/2ssFF;AJJq!$$$,v5ANN1%%%%&,/33		'0B0B0BC+.33		'0B0B0BC

1a   (499W+=+==q!!!!
"$(+ssDIIk,B,B,BCA		;;29;;;<<AJJq!/		rcP|jD]}d|z}||ddS)Nzimport %s as fooz#This module is now multiple modulesrLr4rrOrs   rrUz!Test_urllib.test_import_module_asNsE<	K	KC"S(A  $IJJJJ	K	Krc	|jD]f\}}|D]^\}}|D]V}d|d|d}d|d|d}|||d|d|d|}d|d|d|}|||W_gdS)Nrr as foo_barz
 as blah, rK)rrOrrPrrrTrUs        rrWzTest_urllib.test_import_from_asSs L..00	%	%LC '
%
%W%%%FF:=##vvvFAA:=##vvvFAJJq!$$$$;>33OAA;>33OAJJq!$$$$
%
%	%	%rcP|jD]}d|z}||ddS)NrYzCannot handle star importsrrs   rrZzTest_urllib.test_star^sE<	B	BC"S(A  $@AAAA	B	Brcnd}d}|||d}d}|||dS)Nz6
def foo():
    from urllib import urlencode, urlopen
zZ
def foo():
    from urllib.parse import urlencode
    from urllib.request import urlopen
zB
def foo():
    other()
    from urllib import urlencode, urlopen
zf
def foo():
    other()
    from urllib.parse import urlencode
    from urllib.request import urlopen
rRrSs   r
test_indentedzTest_urllib.test_indentedcsP


	

1a


	

1arc:d}d}|||dS)Nzfrom urllib import getproxiesz%from urllib.request import getproxiesrRrSs   rtest_single_importzTest_urllib.test_single_import|s&+3

1arc|jD]\}}|D]\}}|D]}dd|j|D}d|d|d|d}d|d|d|d}|||d|d|d|d|d|d}d|d|d|d|d|d}|||dS)	Nr9cg|]\}}|Sr;r;)r>rJmemss   rr@z8Test_urllib.test_import_module_usage.<locals>.<listcomp>s.,B,B,B)1dA,B,B,Brz 
                        import z
                        foo(.z)
                        z
                        ()rLrMr-r))	rrOrrPrr
new_importrTrUs	         rr_z$Test_urllib.test_import_module_usagesW L..00	%	%LC '
%
%W%%%F!%,B,B/3|C/@,B,B,B"C"CJJ
 #ssCCC1AA *zz3338AJJq!$$$$ #ssCCCfff>AA *zz333VVVEAJJq!$$$$)%
%	%	%rN)rLr=rMrfixes.fix_urllibrerLrQrSrUrWrZrrr_r;rrrr*sE5555554KKK
	%	%	%BBB
2%%%%%rrc<eZdZdZdZdZdZdZdZdZ	dZ
d	S)

Test_inputinputcnd}d}|||d}d}|||dS)Nzx =   input(   )zx =   eval(input(   ))rzx = eval(input(   ''   ))rRrSs   rrz#Test_input.test_prefix_preservationsD"(

1a%+

1arc:d}d}|||dS)Nzx = input()  #  foozx = eval(input())  #  foorRrSs   rrz Test_input.test_trailing_comment&%+

1arcd}||d}||d}||dS)Nx = eval(input())x = eval(input(''))x = eval(input(foo(5) + 9))r2rs  rrzTest_input.test_idempotencysM#q%q-qrc:d}d}|||dS)Nr!rrRrSs   rr`zTest_input.test_1s&#

1arc:d}d}|||dS)Nr#rrRrSs   rrbzTest_input.test_2rrc:d}d}|||dS)Nr%zx = eval(input('prompt'))rRrSs   rrezTest_input.test_3rrc:d}d}|||dS)Nzx = input(foo(5) + 9)rrRrSs   rrgzTest_input.test_4s&'-

1arN)rLr=rMrrrrr`rbrergr;rrrrsE



rrceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdS)Test_tuple_paramstuple_paramsc4d}||dS)Nzdef foo(): passr2rs  rrz"Test_tuple_params.test_unchanged_1rrc4d}||dS)Nzdef foo(a, b, c): passr2rs  rrz"Test_tuple_params.test_unchanged_2s(qrc4d}||dS)Nzdef foo(a=3, b=4, c=5): passr2rs  rrz"Test_tuple_params.test_unchanged_3rrc:d}d}|||dS)Nz8
            def foo(((a, b), c)):
                x = 5zn
            def foo(xxx_todo_changeme):
                ((a, b), c) = xxx_todo_changeme
                x = 5rRrSs   rr`zTest_tuple_params.test_1,

	

1arc:d}d}|||dS)Nz;
            def foo(((a, b), c), d):
                x = 5zq
            def foo(xxx_todo_changeme, d):
                ((a, b), c) = xxx_todo_changeme
                x = 5rRrSs   rrbzTest_tuple_params.test_2rrc:d}d}|||dS)Nz@
            def foo(((a, b), c), d) -> e:
                x = 5zv
            def foo(xxx_todo_changeme, d) -> e:
                ((a, b), c) = xxx_todo_changeme
                x = 5rRrSs   rrezTest_tuple_params.test_3rrc:d}d}|||dS)Nz/
            def foo(((a, b), c)): x = 5; y = 7zV
            def foo(xxx_todo_changeme): ((a, b), c) = xxx_todo_changeme; x = 5; y = 7rRrSs   rtest_semicolonz Test_tuple_params.test_semicolons+
2
Y

1arc:d}d}|||dS)NzE
            def foo(((a, b), c), d, e=5) -> z:
                x = 5z{
            def foo(xxx_todo_changeme, d, e=5) -> z:
                ((a, b), c) = xxx_todo_changeme
                x = 5rRrSs   r
test_keywordszTest_tuple_params.test_keywordsrrc:d}d}|||dS)NzR
            def foo(((a, b), c), d, *vargs, **kwargs) -> z:
                x = 5z
            def foo(xxx_todo_changeme, d, *vargs, **kwargs) -> z:
                ((a, b), c) = xxx_todo_changeme
                x = 5rRrSs   rtest_varargszTest_tuple_params.test_varargsrrc:d}d}|||dS)NzH
            def foo(((a, b), c), (d, e, f)) -> z:
                x = 5z
            def foo(xxx_todo_changeme, xxx_todo_changeme1) -> z:
                ((a, b), c) = xxx_todo_changeme
                (d, e, f) = xxx_todo_changeme1
                x = 5rRrSs   rtest_multi_1zTest_tuple_params.test_multi_1,


	

1arc:d}d}|||dS)NzQ
            def foo(x, ((a, b), c), d, (e, f, g), y) -> z:
                x = 5z
            def foo(x, xxx_todo_changeme, d, xxx_todo_changeme1, y) -> z:
                ((a, b), c) = xxx_todo_changeme
                (e, f, g) = xxx_todo_changeme1
                x = 5rRrSs   rtest_multi_2zTest_tuple_params.test_multi_2%rrc:d}d}|||dS)Nzj
            def foo(((a, b), c), (d, e, f)) -> z:
                "foo foo foo foo"
                x = 5z
            def foo(xxx_todo_changeme, xxx_todo_changeme1) -> z:
                "foo foo foo foo"
                ((a, b), c) = xxx_todo_changeme
                (d, e, f) = xxx_todo_changeme1
                x = 5rRrSs   rtest_docstringz Test_tuple_params.test_docstring1s,


	

1arc4d}||dS)Nlambda x: x + 5r2rs  rtest_lambda_no_changez'Test_tuple_params.test_lambda_no_change?rrcd}d}|||d}d}|||d}d}|||d}d}|||dS)Nzlambda (x): x + 5rzlambda(x): x + 5zlambda ((((x)))): x + 5zlambda((((x)))): x + 5rRrSs   rtest_lambda_parens_single_argz/Test_tuple_params.test_lambda_parens_single_argCs#!

1a"!

1a)!

1a(!

1arcd}d}|||d}d}|||d}d}|||d}d}|||dS)Nzlambda (x, y): x + f(y)zlambda x_y: x_y[0] + f(x_y[1])zlambda(x, y): x + f(y)zlambda (((x, y))): x + f(y)zlambda(((x, y))): x + f(y)rRrSs   rtest_lambda_simplez$Test_tuple_params.test_lambda_simpleTs)0

1a(0

1a-0

1a,0

1arcnd}d}|||d}d}|||dS)Nzlambda (x,): x + f(x)zlambda x1: x1[0] + f(x1[0])zlambda (((x,))): x + f(x)rRrSs   rtest_lambda_one_tuplez'Test_tuple_params.test_lambda_one_tupleesD'-

1a+-

1arc:d}d}|||dS)Nzlambda (x, y): x + x + f(x) + xz0lambda x_y: x_y[0] + x_y[0] + f(x_y[0]) + x_y[0]rRrSs   rtest_lambda_simple_multi_usez.Test_tuple_params.test_lambda_simple_multi_usens&1B

1arc:d}d}|||dS)Nzlambda (x, y): y + xzlambda x_y: x_y[1] + x_y[0]rRrSs   rtest_lambda_simple_reversez,Test_tuple_params.test_lambda_simple_reversess&&-

1arcnd}d}|||d}d}|||dS)Nzlambda (x, (y, z)): x + y + zz2lambda x_y_z: x_y_z[0] + x_y_z[1][0] + x_y_z[1][1]z!lambda (((x, (y, z)))): x + y + zrRrSs   rtest_lambda_nestedz$Test_tuple_params.test_lambda_nestedxsD/D

1a3D

1arc:d}d}|||dS)Nz lambda (x, (y, z)): x + y + f(y)z5lambda x_y_z: x_y_z[0] + x_y_z[1][0] + f(x_y_z[1][0])rRrSs   rtest_lambda_nested_multi_usez.Test_tuple_params.test_lambda_nested_multi_uses&2G

1arN)rLr=rMrrrrr`rbrerrrrrrrrrrrrrrr;rrrrsEE															





""

rrc&eZdZdZgdZdZdZdS)Test_methodattrsmethodattrs)funcrclassc|jD]T}d|z}|dkrd}nd|z}|||d|z}|dkrd}nd|z}|||UdS)Nza.im_%srza.__self__.__class__r4zself.foo.im_%s.foo_barz#self.foo.__self__.__class__.foo_barr5r6r8s    rrzTest_methodattrs.testsJ
	
	DD Aw*%JJq!(4/Aw9-4JJq!
	
	rc|jD]P}d|z}||d|z}||d|z}||QdS)Nzfoo(im_%s + 5)r;r<r=r>s   rrzTest_methodattrs.test_unchangedstJ		D 4'ANN1$&ANN1#d*ANN1		rNr?r;rrrrsBE%%%E 					rrc eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/S)0	Test_nextnextc:d}d}|||dS)Nz	it.next()znext(it)rRrSs   rr`zTest_next.test_1&

1arc:d}d}|||dS)Nza.b.c.d.next()z
next(a.b.c.d)rRrSs   rrbzTest_next.test_2rrc:d}d}|||dS)Nz(a + b).next()z
next((a + b))rRrSs   rrezTest_next.test_3rrc:d}d}|||dS)Nz
a().next()z	next(a())rRrSs   rrgzTest_next.test_4&

1arc:d}d}|||dS)Nza().next() + bz
next(a()) + brRrSs   rrizTest_next.test_5rrc:d}d}|||dS)Nzc(      a().next() + b)zc(      next(a()) + b)rRrSs   rrlzTest_next.test_6rrc:d}d}|||dS)NzU
            for a in b:
                foo(a)
                a.next()
            zT
            for a in b:
                foo(a)
                next(a)
            rRrSs   rtest_prefix_preservation_1z$Test_next.test_prefix_preservation_1,



	

1arc:d}d}|||dS)Nzq
            for a in b:
                foo(a) # abc
                # def
                a.next()
            zp
            for a in b:
                foo(a) # abc
                # def
                next(a)
            rRrSs   rtest_prefix_preservation_2z$Test_next.test_prefix_preservation_2s,

	

1arc>d}d}|||ddS)Nzj
            next = 5
            for a in b:
                foo(a)
                a.next()
            zn
            next = 5
            for a in b:
                foo(a)
                a.__next__()
            Tr(rRrSs   rtest_prefix_preservation_3z$Test_next.test_prefix_preservation_30

	

1a
.....rc>d}d}|||ddS)Nz
            next = 5
            for a in b:
                foo(a) # abc
                # def
                a.next()
            z
            next = 5
            for a in b:
                foo(a) # abc
                # def
                a.__next__()
            TrrRrSs   rtest_prefix_preservation_4z$Test_next.test_prefix_preservation_4s0

	

1a
.....rc>d}d}|||ddS)Nzz
            next = 5
            for a in b:
                foo(foo(a), # abc
                    a.next())
            z~
            next = 5
            for a in b:
                foo(foo(a), # abc
                    a.__next__())
            TrrRrSs   rtest_prefix_preservation_5z$Test_next.test_prefix_preservation_5	rrc:d}d}|||dS)Nze
            for a in b:
                foo(foo(a), # abc
                    a.next())
            zd
            for a in b:
                foo(foo(a), # abc
                    next(a))
            rRrSs   rtest_prefix_preservation_6z$Test_next.test_prefix_preservation_6	rrc:d}d}|||dS)Nz[
            class A:
                def next(self):
                    pass
            z_
            class A:
                def __next__(self):
                    pass
            rRrSs   r
test_method_1zTest_next.test_method_1	rrc:d}d}|||dS)Nzc
            class A(object):
                def next(self):
                    pass
            zg
            class A(object):
                def __next__(self):
                    pass
            rRrSs   r
test_method_2zTest_next.test_method_2,	rrc:d}d}|||dS)NzX
            class A:
                def next(x):
                    pass
            z\
            class A:
                def __next__(x):
                    pass
            rRrSs   r
test_method_3zTest_next.test_method_39	rrc:d}d}|||dS)Nz
            class A:
                def __init__(self, foo):
                    self.foo = foo

                def next(self):
                    pass

                def __iter__(self):
                    return self
            z
            class A:
                def __init__(self, foo):
                    self.foo = foo

                def __next__(self):
                    pass

                def __iter__(self):
                    return self
            rRrSs   r
test_method_4zTest_next.test_method_4F	s,



	

1arc4d}||dS)Nza
            class A:
                def next(self, a, b):
                    pass
            r2rs  rtest_method_unchangedzTest_next.test_method_unchanged_	#

	
qrc6d}||ddS)Nzy
            next = foo

            class A:
                def next(self, a, b):
                    pass
            )Calls to builtin next() possibly shadowedrWrs  rtest_shadowing_assign_simplez&Test_next.test_shadowing_assign_simpleg	(
	
Q KLLLLLrc6d}||ddS)Nz~
            (next, a) = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_assign_tuple_1z'Test_next.test_shadowing_assign_tuple_1q	rrc6d}||ddS)Nz
            (a, (b, (next, c)), a) = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_assign_tuple_2z'Test_next.test_shadowing_assign_tuple_2{	rrc6d}||ddS)Nz~
            [next, a] = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_assign_list_1z&Test_next.test_shadowing_assign_list_1	rrc6d}||ddS)Nz
            [a, [b, [next, c]], a] = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_assign_list_2z&Test_next.test_shadowing_assign_list_2	rrc6d}||ddS)Nz
            def foo():
                __builtin__.next = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_builtin_assignzTest_next.test_builtin_assign	(
	
Q KLLLLLrc6d}||ddS)Nz
            def foo():
                (a, __builtin__.next) = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_builtin_assign_in_tuplez&Test_next.test_builtin_assign_in_tuple	rrc6d}||ddS)Nz
            def foo():
                [a, __builtin__.next] = foo

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_builtin_assign_in_listz%Test_next.test_builtin_assign_in_list	rrc4d}||dS)Nz
            def foo():
                A.next = foo

            class A:
                def next(self, a, b):
                    pass
            r2rs  rtest_assign_to_nextzTest_next.test_assign_to_next	#
	
qrc4d}||dS)Nz
            def foo():
                (a, A.next) = foo

            class A:
                def next(self, a, b):
                    pass
            r2rs  rtest_assign_to_next_in_tuplez&Test_next.test_assign_to_next_in_tuple	rrc4d}||dS)Nz
            def foo():
                [a, A.next] = foo

            class A:
                def next(self, a, b):
                    pass
            r2rs  rtest_assign_to_next_in_listz%Test_next.test_assign_to_next_in_list	rrc6d}||ddS)Nz
            import foo.bar as next

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_1z!Test_next.test_shadowing_import_1	rrc6d}||ddS)Nz
            import bar, bar.foo as next

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_2z!Test_next.test_shadowing_import_2	rrc6d}||ddS)Nz
            import bar, bar.foo as next, baz

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_3z!Test_next.test_shadowing_import_3	rrc6d}||ddS)Nz
            from x import next

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_from_1z&Test_next.test_shadowing_import_from_1	rrc6d}||ddS)Nz
            from x.a import next

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_from_2z&Test_next.test_shadowing_import_from_2
rrc6d}||ddS)Nz
            from x import a, next, b

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_from_3z&Test_next.test_shadowing_import_from_3
rrc6d}||ddS)Nz
            from x.a import a, next, b

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_import_from_4z&Test_next.test_shadowing_import_from_4
rrc6d}||ddS)Nz
            def next(a):
                pass

            class A:
                def next(self, a, b):
                    pass
            rrWrs  rtest_shadowing_funcdef_1z"Test_next.test_shadowing_funcdef_1!
rrc<d}d}|||ddS)Nz
            def next(a):
                pass

            class A:
                def next(self):
                    pass

            it.next()
            z
            def next(a):
                pass

            class A:
                def __next__(self):
                    pass

            it.__next__()
            rr3rSs   rtest_shadowing_funcdef_2z"Test_next.test_shadowing_funcdef_2,
s/	
	
	

1aDEEEEErc6d}||ddS)NzW
            def f():
                global next
                next = 5
            rrWrs  rtest_shadowing_global_1z!Test_next.test_shadowing_global_1C
(

	
Q KLLLLLrc6d}||ddS)Nz]
            def f():
                global a, next, b
                next = 5
            rrWrs  rtest_shadowing_global_2z!Test_next.test_shadowing_global_2K
r0rc6d}||ddS)Nze
            for next in it():
                pass

            b = 5
            c = 6
            rrWrs  rtest_shadowing_for_simplez#Test_next.test_shadowing_for_simpleS
rrc6d}||ddS)Nzh
            for next, b in it():
                pass

            b = 5
            c = 6
            rrWrs  rtest_shadowing_for_tuple_1z$Test_next.test_shadowing_for_tuple_1]
rrc6d}||ddS)Nzp
            for a, (next, c), b in it():
                pass

            b = 5
            c = 6
            rrWrs  rtest_shadowing_for_tuple_2z$Test_next.test_shadowing_for_tuple_2g
rrc:d}d}|||dS)Nzgnext = g.nextzgnext = g.__next__rRrSs   rtest_noncall_access_1zTest_next.test_noncall_access_1q
& $

1arc:d}d}|||dS)Nz
f(g.next + 5)zf(g.__next__ + 5)rRrSs   rtest_noncall_access_2zTest_next.test_noncall_access_2v
rrc:d}d}|||dS)Nzf(g().next + 5)zf(g().__next__ + 5)rRrSs   rtest_noncall_access_3zTest_next.test_noncall_access_3{
s&!%

1arN)1rLr=rMrr`rbrergrirlrrrrrrrrrrrrrr	rr
rrrrrrrrr!r#r%r'r)r+r-r/r2r4r6r8r:r=r?r;rrrrsE









/
/
////"
/
/
/2MMMMMMMMMMMMMMM	M	M	M	M	M	M	M	M	M									MMMMMMMMMMMMMMMMMMMMM	M	M	MFFF.MMMMMMMMMMMMMMM

rrc0eZdZdZdZdZdZdZdZdS)Test_nonzerononzeroc:d}d}|||dS)Nzb
            class A:
                def __nonzero__(self):
                    pass
            z_
            class A:
                def __bool__(self):
                    pass
            rRrSs   rr`zTest_nonzero.test_1
rrc:d}d}|||dS)Nzj
            class A(object):
                def __nonzero__(self):
                    pass
            g
            class A(object):
                def __bool__(self):
                    pass
            rRrSs   rrbzTest_nonzero.test_2
rrc4d}||dS)NrEr2rs  rrzTest_nonzero.test_unchanged_1
rrc4d}||dS)Nzm
            class A(object):
                def __nonzero__(self, a):
                    pass
            r2rs  rrzTest_nonzero.test_unchanged_2
rrc4d}||dS)NzE
            def __nonzero__(self):
                pass
            r2rs  rtest_unchanged_funcz Test_nonzero.test_unchanged_func
s#
	
qrN)	rLr=rMrr`rbrrrIr;rrrArA
sdErrAc`eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdS)Test_numliteralsnumliteralsc:d}d}|||dS)N07550o755rRrSs   rtest_octal_1zTest_numliterals.test_octal_1
s&

1arc:d}d}|||dS)Nza = 12La = 12rRrSs   rtest_long_int_1z Test_numliterals.test_long_int_1
&

1arc:d}d}|||dS)Nza = 12lrRrRrSs   rtest_long_int_2z Test_numliterals.test_long_int_2
rTrc:d}d}|||dS)Nz	b = 0x12lzb = 0x12rRrSs   r
test_long_hexzTest_numliterals.test_long_hex
rrcnd}d}|||d}d}|||dS)Nzb =   0x12Lz
b =   0x12zb = 0755 # spamzb = 0o755 # spamrRrSs   rtest_comments_and_spacingz*Test_numliterals.test_comments_and_spacing
sD

1a!"

1arc4d}||dS)N5r2rs  rtest_unchanged_intz#Test_numliterals.test_unchanged_int
sqrc4d}||dS)Nz5.0r2rs  rtest_unchanged_floatz%Test_numliterals.test_unchanged_float
sqrc4d}||dS)NrOr2rs  rtest_unchanged_octalz%Test_numliterals.test_unchanged_octal
qrc4d}||dS)N0xABCr2rs  rtest_unchanged_hexz#Test_numliterals.test_unchanged_hex
rbrc4d}||dS)Nz5.0e10r2rs  rtest_unchanged_expz#Test_numliterals.test_unchanged_exp
qrc4d}||dS)Nz5 + 4jr2rs  rtest_unchanged_complex_intz+Test_numliterals.test_unchanged_complex_int
rhrc4d}||dS)Nz
5.4 + 4.9jr2rs  rtest_unchanged_complex_floatz-Test_numliterals.test_unchanged_complex_float
r	rcbd}||d}||dS)N4jz4.4jr2rs  rtest_unchanged_complex_barez,Test_numliterals.test_unchanged_complex_bare
s6qqrN)rLr=rMrrPrSrVrXrZr]r_rarergrjrlror;rrrKrK
sE



rrKc2eZdZdZddiZdZdZdZdZdS)	Test_renamesrenamessys)maxintmaxsizect|jD]H\}\}}d|d|}d|d|}|||d|z}||IdS)Nrrr)listrLrMr)r/)rmodrOrPrTrUrs       rrSzTest_renames.test_import_from
s#DL$6$6$8$899		OC#ss'*ssCC0AA'*ssCC0AJJq!$s*ANN1
		rct|jD]0\}\}}d|d|d}d|d|d}|||1dS)NrrrrwrLrMr)rrxrOrPrTrUs      rrWz Test_renames.test_import_from_assx#DL$6$6$8$899		OC#ss25##sss;AA25##sss;AJJq!		rc
t|jD]<\}\}}d|d|d|d|d	}d|d|d|d|d	}|||=dS)Nr\r]r9r)
                rzr{s      rr_z%Test_renames.test_import_module_usages#DL$6$6$8$899				OC#ssssCCCccc+AAssCCCccc+A
JJq!				rc
t|jD]<\}\}}d|d|d|d|d	}d|d|d|d|d	}|||=dS)Nr^rr]r9r}rzr{s      rXXX_test_from_import_usagez'Test_renames.XXX_test_from_import_usages#DL$6$6$8$899				OC#ssssCCCccc+AAssCCCccc+A
JJq!				rN)	rLr=rMrrLrSrWr_rr;rrrqrq
sbE,G


rrqcNeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dS)
Test_unicodeunicodecd}d}|||d}d}|||d}d}|||dS)Nzunicode( x)zstr( x)z unicode(x )z str(x )z u'h'z 'h'rRrSs   rtest_whitespacezTest_unicode.test_whitespace'sb

1a

1a

1arc:d}d}|||dS)Nzunicode(x, y, z)zstr(x, y, z)rRrSs   rtest_unicode_callzTest_unicode.test_unicode_call4rrc:d}d}|||dS)Nzunichr(u'h')zchr('h')rRrSs   rtest_unichrzTest_unicode.test_unichr9s&

1arc:d}d}|||dS)Nzu"x"z"x"rRrSs   rtest_unicode_literal_1z#Test_unicode.test_unicode_literal_1>s&

1arc:d}d}|||dS)Nzur'x'zr'x'rRrSs   rtest_unicode_literal_2z#Test_unicode.test_unicode_literal_2Cs&

1arc:d}d}|||dS)Nz
UR'''x''' z	R'''x''' rRrSs   rtest_unicode_literal_3z#Test_unicode.test_unicode_literal_3Hrrcnd}d}|||d}d}|||dS)N'\\\u20ac\U0001d121\\u20ac'z'\\\\u20ac\\U0001d121\\u20ac'r'\\\u20ac\U0001d121\\u20ac'rRrSs   rtest_native_literal_escape_uz)Test_unicode.test_native_literal_escape_uMsD.0

1a//

1arcnd}d}|||d}d}|||dS)Nzb'\\\u20ac\U0001d121\\u20ac'zbr'\\\u20ac\U0001d121\\u20ac'rRrSs   rtest_bytes_literal_escape_uz(Test_unicode.test_bytes_literal_escape_uVsD//

1a00

1arcnd}d}|||d}d}|||dS)Nzu'\\\u20ac\U0001d121\\u20ac'rzur'\\\u20ac\U0001d121\\u20ac'rrRrSs   rtest_unicode_literal_escape_uz*Test_unicode.test_unicode_literal_escape_u_sD/.

1a0/

1arcd}|dz}|dz}||||dz}|dz}|||dS)Nz(from __future__ import unicode_literals
rrrR)rfrTrUs    r$test_native_unicode_literal_escape_uz1Test_unicode.test_native_unicode_literal_escape_uhsa7
22
22

1a
33
33

1arN)rLr=rMrrrrrrrrrrrr;rrrr$sE




rrc0eZdZdZdZdZdZdZdZdS)Test_filterfiltercnd}d}|||d}d}|||dS)Nz#x =   filter(    foo,     'abc'   )z)x =   list(filter(    foo,     'abc'   ))zx =   filter(  None , 'abc'  )z x =   [_f for _f in 'abc' if _f]rRrSs   rrz$Test_filter.test_prefix_preservationvsD5;

1a02

1arc
d}d}|||d}d}|||d}d}|||d}d}|||d}d	}|||dS)
Nzx = filter(None, 'abc')zx = [_f for _f in 'abc' if _f]zx = len(filter(f, 'abc'))zx = len(list(filter(f, 'abc')))z)x = filter(lambda x: x%2 == 0, range(10))z&x = [x for x in range(10) if x%2 == 0]z+x = filter(lambda (x): x%2 == 0, range(10))z5filter(lambda x: True if x > 2 else False, [1, 2, 3])z4[x for x in [1, 2, 3] if (True if x > 2 else False)]rRrSs   rtest_filter_basiczTest_filter.test_filter_basics)0

1a+1

1a;8

1a
>8

1a
HF

1arcd}d}|||d}d}|||d}d}|||d}d}|||dS)Nzx = filter(None, 'abc')[0]z!x = [_f for _f in 'abc' if _f][0]zx = len(filter(f, 'abc')[0])z"x = len(list(filter(f, 'abc'))[0])z,x = filter(lambda x: x%2 == 0, range(10))[0]z)x = [x for x in range(10) if x%2 == 0][0]z.x = filter(lambda (x): x%2 == 0, range(10))[0]rRrSs   rtest_filter_trailersz Test_filter.test_filter_trailerss,3

1a.4

1a>;

1a
A;

1arcpd}||d}||d}||d}||d}||d}||d}||d}||d	}||d
}||d}||d}||d
}||d}||d}||d}||d}||d}||d}||dS)Nzb.join(filter(f, 'abc'))z#(a + foo(5)).join(filter(f, 'abc'))ziter(filter(f, 'abc'))zlist(filter(f, 'abc'))zlist(filter(f, 'abc'))[0]zset(filter(f, 'abc'))zset(filter(f, 'abc')).pop()ztuple(filter(f, 'abc'))zany(filter(f, 'abc'))zall(filter(f, 'abc'))zsum(filter(f, 'abc'))zsorted(filter(f, 'abc'))z"sorted(filter(f, 'abc'), key=blah)z%sorted(filter(f, 'abc'), key=blah)[0]zenumerate(filter(f, 'abc'))z$enumerate(filter(f, 'abc'), start=1)zfor i in filter(f, 'abc'): passz[x for x in filter(f, 'abc')]z(x for x in filter(f, 'abc'))r2rrUs  rtest_filter_nochangez Test_filter.test_filter_nochanges*q5q(q(q+q'q-q)q'q'q'q*q4q7q-q6q1q/q/qrcd}||d}d}|||d}||dS)Nz:from future_builtins import spam, filter; filter(f, 'ham')z6from future_builtins import spam; x = filter(f, 'abc')z<from future_builtins import spam; x = list(filter(f, 'abc'))z/from future_builtins import *; filter(f, 'ham')rrs   rtest_future_builtinsz Test_filter.test_future_builtinssTHqHN

1a=qrN)	rLr=rMrrrrrrr;rrrrsseE.$&&&P					rrcLeZdZdZfdZdZdZdZdZdZ	dZ
d	ZxZS)
Test_maprc|d|z|tt|||dS)Nz!from future_builtins import map; )r/rrr)rrTrUr<s   rr)zTest_map.checkC:Q>BBB
h##Aq)))))rc:d}d}|||dS)Nzx =    map(   f,    'abc'   )z#x =    list(map(   f,    'abc'   ))rRrSs   rrz!Test_map.test_prefix_preservations&/5

1arcd}d}|||d}d}|||d}d}|||d}d}|||dS)	Nzx = map(f, 'abc')[0]zx = list(map(f, 'abc'))[0]zx = map(None, l)[0]zx = list(l)[0]zx = map(lambda x:x, l)[0]zx = [x for x in l][0]zx = map(f, 'abc')[0][1]zx = list(map(f, 'abc'))[0][1]rRrSs   rtest_map_trailerszTest_map.test_map_trailerss&,

1a% 

1a+'

1a)/

1arc:d}d}|||dS)Nzx = map(f, 'abc')   #   fooz!x = list(map(f, 'abc'))   #   foorRrSs   rrzTest_map.test_trailing_comments&-3

1arc6d}||ddS)Nzx = map(None, a, b, c)z5cannot convert map(None, ...) with multiple argumentsrWrs  r!test_None_with_multiple_argumentsz*Test_map.test_None_with_multiple_argumentss0(Q!2	3	3	3	3	3rc@d}d}|||d}d}|||d}d}|||d}d}|||d	}d}|||d
}d}|||ddS)
Nzx = map(f, 'abc')zx = list(map(f, 'abc'))zx = len(map(f, 'abc', 'def'))z#x = len(list(map(f, 'abc', 'def')))zx = map(None, 'abc')zx = list('abc')z x = map(lambda x: x+1, range(4))zx = [x+1 for x in range(4)]z"x = map(lambda (x): x+1, range(4))zG
            foo()
            # foo
            map(f, x)
            zM
            foo()
            # foo
            list(map(f, x))
            zYou should use a for loop here)r)r0rSs   rtest_map_basiczTest_map.test_map_basics#)

1a/5

1a&!

1a2-

1a
5-

1a



	

1a9:::::rcpd}||d}||d}||d}||d}||d}||d}||d}||d	}||d
}||d}||d}||d
}||d}||d}||d}||d}||d}||d}||dS)Nzb.join(map(f, 'abc'))z (a + foo(5)).join(map(f, 'abc'))ziter(map(f, 'abc'))zlist(map(f, 'abc'))zlist(map(f, 'abc'))[0]zset(map(f, 'abc'))zset(map(f, 'abc')).pop()ztuple(map(f, 'abc'))zany(map(f, 'abc'))zall(map(f, 'abc'))zsum(map(f, 'abc'))zsorted(map(f, 'abc'))zsorted(map(f, 'abc'), key=blah)z"sorted(map(f, 'abc'), key=blah)[0]zenumerate(map(f, 'abc'))z!enumerate(map(f, 'abc'), start=1)zfor i in map(f, 'abc'): passz[x for x in map(f, 'abc')]z(x for x in map(f, 'abc'))r2rs  rtest_map_nochangezTest_map.test_map_nochange$s'q2q%q%q(q$q*q&q$q$q$q'q1q4q*q3q.q,q,qrcd}||d}d}|||d}||dS)Nz:from future_builtins import spam, map, eggs; map(f, 'ham')z9from future_builtins import spam, eggs; x = map(f, 'abc')z?from future_builtins import spam, eggs; x = list(map(f, 'abc'))z,from future_builtins import *; map(f, 'ham')rrs   rrzTest_map.test_future_builtinsLsTHqKQ

1a:qr)
rLr=rMrr)rrrrrrrrrs@rrrsE*****
"
333
 ; ; ;D&&&P							rrc:eZdZdZfdZdZdZdZdZxZ	S)Test_zipzipc|d|z|tt|||dS)Nz!from future_builtins import zip; )r/rrr)rs   rr)zTest_zip.checkZrrcd}d}|||d}d}|||d}d}|||dS)Nz	x = zip()zx = list(zip())zx = zip(a, b, c)zx = list(zip(a, b, c))zx = len(zip(a, b))zx = len(list(zip(a, b)))rRrSs   rtest_zip_basiczTest_zip.test_zip_basic^sb!

1a"(

1a$*

1arcnd}d}|||d}d}|||dS)Nzx = zip(a, b, c)[0]zx = list(zip(a, b, c))[0]zx = zip(a, b, c)[0][1]zx = list(zip(a, b, c))[0][1]rRrSs   rtest_zip_trailerszTest_zip.test_zip_trailersksD%+

1a(.

1arcpd}||d}||d}||d}||d}||d}||d}||d}||d	}||d
}||d}||d}||d
}||d}||d}||d}||d}||d}||d}||dS)Nzb.join(zip(a, b))z(a + foo(5)).join(zip(a, b))ziter(zip(a, b))zlist(zip(a, b))zlist(zip(a, b))[0]zset(zip(a, b))zset(zip(a, b)).pop()ztuple(zip(a, b))zany(zip(a, b))zall(zip(a, b))zsum(zip(a, b))zsorted(zip(a, b))zsorted(zip(a, b), key=blah)zsorted(zip(a, b), key=blah)[0]zenumerate(zip(a, b))zenumerate(zip(a, b), start=1)zfor i in zip(a, b): passz[x for x in zip(a, b)]z(x for x in zip(a, b))r2rs  rtest_zip_nochangezTest_zip.test_zip_nochangets#q.q!q!q$q q&q"q q q q#q-q0q&q/q*q(q(qrcd}||d}d}|||d}||dS)Nz6from future_builtins import spam, zip, eggs; zip(a, b)z5from future_builtins import spam, eggs; x = zip(a, b)z;from future_builtins import spam, eggs; x = list(zip(a, b))z(from future_builtins import *; zip(a, b)rrs   rrzTest_zip.test_future_builtinssTDqGM

1a6qr)
rLr=rMrr)rrrrrrs@rrrWszE*****&&&P							rrceZdZdZdZdS)Test_standarderror
standarderrorcd}d}|||d}d}|||d}d}|||dS)Nzx =    StandardError()zx =    Exception()zx = StandardError(a, b, c)zx = Exception(a, b, c)zf(2 + StandardError(a, b, c))zf(2 + Exception(a, b, c))rRrSs   rrzTest_standarderror.testsb($

1a,(

1a/+

1arN)rLr=rMrrr;rrrrs(ErrceZdZdZdZdS)
Test_typestypescrd}d}|||d}d}|||d}d}|||d}d}|||d	}d}|||d
}d}|||d}d
}|||dS)Nztypes.StringTypebytesztypes.DictTyperztypes . IntTypeintztypes.ListTyperwztypes.LongTypeztypes.NoneTypez
type(None)ztypes.StringTypesz(str,)rRrSs   rtest_basic_types_convertz#Test_types.test_basic_types_converts"

1a 

1a!

1a 

1a 

1a 

1a

1arN)rLr=rMrrr;rrrrs(Errc~eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdS)Test_idiomsidiomscd}d}|||d}d}|||d}d}|||dS)Nzwhile 1: foo()zwhile True: foo()zwhile   1: foo()zwhile   True: foo()z8
            while 1:
                foo()
            z;
            while True:
                foo()
            rRrSs   r
test_whilezTest_idioms.test_whilesh #

1a"%

1a

	

1arcd}||d}||d}||d}||dS)Nzwhile 11: foo()zwhile 0: foo()zwhile foo(): foo()zwhile []: foo()r2rs  rtest_while_unchangedz Test_idioms.test_while_unchangedsd!q q$q!qrcnd}d}|||d}d}|||dS)Nztype(x) == Tisinstance(x, T)zif   type(x) == T: passif   isinstance(x, T): passrRrSs   rtest_eq_simplezTest_idioms.test_eq_simpleD"

1a)-

1arcnd}d}|||d}d}|||dS)NzT == type(x)rzif   T == type(x): passrrRrSs   rtest_eq_reversezTest_idioms.test_eq_reverse
rrcnd}d}|||d}d}|||dS)Nztype(x+y) == d.get('T')isinstance(x+y, d.get('T'))ztype(   x  +  y) == d.get('T')isinstance(x  +  y, d.get('T'))rRrSs   rtest_eq_expressionzTest_idioms.test_eq_expression
D)-

1a01

1arcnd}d}|||d}d}|||dS)Nztype(x) is Trzif   type(x) is T: passrrRrSs   rtest_is_simplezTest_idioms.test_is_simple
rrcnd}d}|||d}d}|||dS)NzT is type(x)rzif   T is type(x): passrrRrSs   rtest_is_reversezTest_idioms.test_is_reverse
rrcnd}d}|||d}d}|||dS)Nztype(x+y) is d.get('T')rztype(   x  +  y) is d.get('T')rrRrSs   rtest_is_expressionzTest_idioms.test_is_expression'
rrcnd}d}|||d}d}|||dS)Nztype(x) is not Tnot isinstance(x, T)zif   type(x) is not T: passif   not isinstance(x, T): passrRrSs   rtest_is_not_simplezTest_idioms.test_is_not_simple0
D"&

1a-1

1arcnd}d}|||d}d}|||dS)NzT is not type(x)rzif   T is not type(x): passrrRrSs   rtest_is_not_reversezTest_idioms.test_is_not_reverse9
rrcnd}d}|||d}d}|||dS)Nztype(x+y) is not d.get('T')not isinstance(x+y, d.get('T'))z"type(   x  +  y) is not d.get('T')#not isinstance(x  +  y, d.get('T'))rRrSs   rtest_is_not_expressionz"Test_idioms.test_is_not_expressionB
sD-1

1a45

1arcnd}d}|||d}d}|||dS)Nztype(x) != Trzif   type(x) != T: passrrRrSs   rtest_ne_simplezTest_idioms.test_ne_simpleK
D&

1a)1

1arcnd}d}|||d}d}|||dS)NzT != type(x)rzif   T != type(x): passrrRrSs   rtest_ne_reversezTest_idioms.test_ne_reverseT
rrcnd}d}|||d}d}|||dS)Nztype(x+y) != d.get('T')rztype(   x  +  y) != d.get('T')rrRrSs   rtest_ne_expressionzTest_idioms.test_ne_expression]
sD)1

1a05

1arc4d}||dS)Nztype(x).__name__r2rs  rtest_type_unchangedzTest_idioms.test_type_unchangedf
rrcd}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||d}d}|||d
}d}|||d}d}|||dS)NzM
            v = list(t)
            v.sort()
            foo(v)
            :
            v = sorted(t)
            foo(v)
            zV
            v = list(foo(b) + d)
            v.sort()
            foo(v)
            C
            v = sorted(foo(b) + d)
            foo(v)
            zn
            while x:
                v = list(t)
                v.sort()
                foo(v)
            W
            while x:
                v = sorted(t)
                foo(v)
            z_
            v = list(t)
            # foo
            v.sort()
            foo(v)
            L
            v = sorted(t)
            # foo
            foo(v)
            zP
            v = list(   t)
            v.sort()
            foo(v)
            z=
            v = sorted(   t)
            foo(v)
            zl
            try:
                m = list(s)
                m.sort()
            except: pass
            zU
            try:
                m = sorted(s)
            except: pass
            z
            try:
                m = list(s)
                # foo
                m.sort()
            except: pass
            zk
            try:
                m = sorted(s)
                # foo
            except: pass
            zI
            m = list(s)
            # more comments
            m.sort()z6
            m = sorted(s)
            # more commentsrRrSs   rtest_sort_list_callzTest_idioms.test_sort_list_callj
s(


	

1a


	

1a


	

1a


	

1a


	

1a


	

1a

	

1a


	

1arcrd}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||d}d}|||d
}d}|||dS)NzG
            v = t
            v.sort()
            foo(v)
            rzL
            v = foo(b)
            v.sort()
            foo(v)
            z?
            v = sorted(foo(b))
            foo(v)
            zN
            v = b.keys()
            v.sort()
            foo(v)
            zA
            v = sorted(b.keys())
            foo(v)
            zP
            v = foo(b) + d
            v.sort()
            foo(v)
            rzh
            while x:
                v = t
                v.sort()
                foo(v)
            rzY
            v = t
            # foo
            v.sort()
            foo(v)
            rzI
            v =   t
            v.sort()
            foo(v)
            z<
            v =   sorted(t)
            foo(v)
            rRrSs   rtest_sort_simple_exprz!Test_idioms.test_sort_simple_expr
s


	

1a


	

1a


	

1a


	

1a


	

1a


	

1a


	

1arcbd}||d}||dS)NzM
            v = list(t)
            w.sort()
            foo(w)
            zN
            v = list(t)
            v.sort(u)
            foo(v)
            r2rs  rtest_sort_unchangedzTest_idioms.test_sort_unchanged s>

	
q

	
qrN)rLr=rMrrrrrrrrrrrrrrrrrrrr;rrrrs/E&bbbHPPPd




rrceZdZdZdZdS)Test_basestring
basestringc:d}d}|||dS)Nzisinstance(x, basestring)zisinstance(x, str)rRrSs   rtest_basestringzTest_basestring.test_basestring2s&+$

1arN)rLr=rMrrr;rrrr/s(ErrceZdZdZdZdZdS)Test_bufferbufferc:d}d}|||dS)Nz
x = buffer(y)zx = memoryview(y)rRrSs   rtest_bufferzTest_buffer.test_buffer:rrc:d}d}|||dS)Nzbuffer(y)[4:5]zmemoryview(y)[4:5]rRrSs   rtest_slicingzTest_buffer.test_slicing?r;rN)rLr=rMrr
rr;rrr
r
7s7E
rr
ceZdZdZdZdZdS)Test_futurefuturecd}d}|||d}d}|||d}d}|||dS)Nzfrom __future__ import bracesr+z'# comment
from __future__ import bracesz
# comment
z'from __future__ import braces
# commentz

# commentrRrSs   rtest_futurezTest_future.test_futureGsb/

1a:

1a:

1arc0|ddS)NrrKrs rtest_run_orderzTest_future.test_run_orderTsw'''''rN)rLr=rMrrrr;rrrrDs7E(((((rrcBeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
S)Test_itertools	itertoolscfdD]-}dD](}||dz|zz}||z}|||).dS)N)z
itertools.r+)rrrirR)rr!r"rrrTrUs       rcheckallzTest_itertools.checkallZsc$	!	!A-
!
!QsU1W%AJ

1a    
!	!	!rc:d}d}|||dS)Nzitertools.izip(a, b)z	zip(a, b)rRrSs   rtest_0zTest_itertools.test_0ds(
#

1arc:d}d}|||dS)Nz%s(f, a)rrSs   rr`zTest_itertools.test_1ks&

arcnd}d}|||d}d}|||dS)Nzitertools.ifilterfalse(a, b)zitertools.filterfalse(a, b)zitertools.izip_longest(a, b)zitertools.zip_longest(a, b)rRrSs   rtest_qualifiedzTest_itertools.test_qualifiedpsD.-

1a.-

1arcnd}d}|||d}d}|||dS)Nzifilterfalse(a, b)zfilterfalse(a, b)zizip_longest(a, b)zzip_longest(a, b)rRrSs   rrbzTest_itertools.test_2ysD$#

1a$#

1arc:d}d}|||dS)Nz    %s(f, a)r!rSs   rrzTest_itertools.test_space_1s&

arcnd}d}|||d}d}|||dS)Nz     itertools.ifilterfalse(a, b)z    itertools.filterfalse(a, b)z     itertools.izip_longest(a, b)z    itertools.zip_longest(a, b)rRrSs   rrzTest_itertools.test_space_2sD21

1a21

1arc4|ddddS)Nrrrrrs rrzTest_itertools.test_run_orders ueX66666rN)rLr=rMrrrr`r#rbrrrr;rrrrWsE!!!

77777rrc<eZdZdZdZdZdZdZdZdZ	dZ
d	S)
Test_itertools_importsitertools_importscd}d}|||d}d}|||d}d}|||dS)Nz%from itertools import imap, izip, foofrom itertools import fooz*from itertools import bar, imap, izip, foozfrom itertools import bar, fooz'from itertools import chain, imap, izipzfrom itertools import chainrRrSs   rtest_reducedz#Test_itertools_imports.test_reducedsb3'

1a8,

1a5)

1arc:d}d}|||dS)Nz%#foo
from itertools import imap, izipz#foo
rRrSs   r
test_commentsz$Test_itertools_imports.test_commentss&4

1arcnd}d}|||d}d}|||dS)Nz from itertools import imap, izipr+zfrom itertools import iziprRrSs   r	test_nonez Test_itertools_imports.test_nonesD.

1a(

1arcd}d}|||d}d}|||d}d}|||d}d}|||d}||dS)Nz-from itertools import izip, bar as bang, imapz!from itertools import bar as bangz-from itertools import izip as _zip, imap, barzfrom itertools import barz"from itertools import imap as _mapr+z0from itertools import imap as _map, izip as _zip)r)r/)rrTrUrs    rtest_import_asz%Test_itertools_imports.test_import_ass;/

1a;'

1a0

1a>

1a/qrcdD]f}d|}d|}|||d|d}d|d}|||d|d}d|d}|||gdS)N)filterfalsezip_longestzfrom itertools import izfrom itertools import zfrom itertools import imap, iz, foozfrom itertools import bar, izfrom itertools import bar, rR)rr/rTrUs    rtest_ifilter_and_zip_longestz3Test_itertools_imports.test_ifilter_and_zip_longests0		DD/3t5AA.2d4AJJq!:>$$@AA37449AJJq!9=?AA8<>AJJq!		rc4d}||dS)Nzfrom itertools import *r2rs  rtest_import_starz'Test_itertools_imports.test_import_star%qrc4d}||dS)Nr,r2rs  rrz%Test_itertools_imports.test_unchangeds'qrN)rLr=rMrr-r/r1r3r7r9rr;rrr)r)sE
(
rr)ceZdZdZfdZdZfdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZxZS)Test_importr|cttg_t	_d_fd}ddlm}||_	dS)NTcXj|jp|jvSr)
files_checkedr
always_exists
present_files)r/rs rfake_existsz&Test_import.setUp.<locals>.fake_existss0%%d+++%E$$2D*DErr
fix_import)
rr=rr@setrBrA
lib2to3.fixesrEexists)rrCrEr<s`  rrzTest_import.setUps~
k4  &&(((  UU!	F	F	F	F	F	-,,,,,'
rc>ddlm}tjj|_dS)NrrD)rGrEospathrH)rrEs  rtearDownzTest_import.tearDowns&,,,,,,GN
rcd|_tt|||d|_tt||dS)NTF)rArr=r)r/rs   r
check_bothzTest_import.check_bothsW!
k4  &&q!,,,"
k4  **1-----rc*d}d|_tdg|_dtjjddddf}|d	d
|df}|D]g|_|_|dtj	r#tj	d
zndtfd|D}|
d|t|j|dS)Ncptjj|dS)N/)rJrKpathsepr-split)rKs rpz)Test_import.test_files_checked.<locals>.ps$7?''

3888rF__init__.pyz.pyz.pycz.soz.slz.pydz
/spam/eggs.pyzni.pyz../../shrubbery.pyz
import jamz/jamjamc3"K|]	}|zV
dSrr;)r>extr/s  r	<genexpr>z1Test_import.test_files_checked.<locals>.<genexpr>s'!L!L$*!L!L!L!L!L!Lr)rArFrBrJrKsepr@rr/dirnameaddr)rrTexpected_extensions
names_to_testexpected_checksr/s     @rtest_files_checkedzTest_import.test_files_checkeds4	9	9	9# -11$bgk65%P?++Waa8L6M6MN
!	G	GD!#D DMNN<(((wt$$
wt,,v5!!L!L!L!L8K!L!L!LLLO
...S!344oFFFF	G	Grcld}d|_tdg|_||dS)N
import barFbar.pyrArFrBr/rs  rtest_not_in_packagezTest_import.test_not_in_packages7" (__qrcnd}d|_tddg|_||dS)Nz1from __future__ import absolute_import
import barFrUrcrdrs  r!test_with_absolute_import_enabledz-Test_import.test_with_absolute_import_enableds<@" -!:;;qrctd}d}d|_tddg|_|||dS)Nrbfrom . import barFrUrc)rArFrBr)rSs   rtest_in_packagezTest_import.test_in_packagesC" -!:;;

1arcd}d}d|_tddtjjzg|_|||dS)NrbriFrUbar)rArFrJrKrZrBr)rSs   rtest_import_from_packagez$Test_import.test_import_from_package$sL" -1D!EFF

1arc4d}||dS)Nrir2rs  rtest_already_relative_importz(Test_import.test_already_relative_import+sqrc:d}d}|||dS)Nzimport bar # Foozfrom . import bar # FoorRrSs   rtest_comments_and_indentz$Test_import.test_comments_and_indent/s&%

1arcd}d}|||d}d}|||d}d}|||dS)Nzfrom foo import bar, bazzfrom .foo import bar, bazzfrom foo import barzfrom .foo import barzfrom foo import (bar, baz)zfrom .foo import (bar, baz)rNrSs   r	test_fromzTest_import.test_from4sb&'1!"1()1rc:d}d}|||dS)Nzfrom green.eggs import hamzfrom .green.eggs import hamrsrSs   rtest_dotted_fromzTest_import.test_dotted_fromAs&()1rc:d}d}|||dS)Nz"from green.eggs import ham as spamz#from .green.eggs import ham as spamrsrSs   rtest_from_aszTest_import.test_from_asFs&011rcd}d}|||d}d}|||d}d}|||d}d}|||dS)	Nz
import foozfrom . import fooimport foo, barzfrom . import foo, barzimport foo, bar, xzfrom . import foo, bar, xzimport x, y, zzfrom . import x, y, zrsrSs   rtest_importzTest_import.test_importKs1$1 '1#1rcnd}d}|||d}d}|||dS)Nzimport foo as xzfrom . import foo as xzimport a as b, b as c, c as dz$from . import a as b, b as c, c as drsrSs   rr3zTest_import.test_import_as\sD$1+21rcpd|_tddg|_d}||ddS)NFzfoo.pyrUrzz#absolute and local imports together)rArFrBr4rs  rtest_local_and_absolutez#Test_import.test_local_and_absoluteesA" (M!:;;Q EFFFFFrc:d}d}|||dS)Nzimport foo.barzfrom . import foo.barrsrSs   rtest_dotted_importzTest_import.test_dotted_importls&#1rc:d}d}|||dS)Nzimport foo.bar as bangzfrom . import foo.bar as bangrsrSs   rtest_dotted_import_asz!Test_import.test_dotted_import_asqs&$+1rc:d}d}|||dS)Nz1
        # prefix
        import foo.bar
        z8
        # prefix
        from . import foo.bar
        rsrSs   rtest_prefixzTest_import.test_prefixvs,

	
1r)rLr=rMrrrLrNr`rergrjrmrorqrtrvrxr{r3r~rrrrrs@rr=r=s[E(((((+++.....GGG0


"GGG

							rr=c0eZdZdZdZdZdZdZdZdS)Test_set_literalset_literalcd}d}|||d}d}|||d}d}|||d}|||d}d}|||d	}|||d
}d}|||d}d
}|||d}d}|||dS)Nzset([1, 2, 3])z	{1, 2, 3}zset((1, 2, 3))z	set((1,)){1}zset([1])zset((a, b))z{a, b}zset([a, b])zset((a*234, f(args=23)))z{a*234, f(args=23)}zset([a*23, f(23)])z
{a*23, f(23)}zset([a-234**23])z{a-234**23}rRrSs   rrVzTest_set_literal.test_basics 

1a 

1a

1a

1a

1a

1a*%

1a$

1a"

1arcd}d}|||d}d}|||d}d}|||d}d}|||dS)	Nzset([x for x in y])z{x for x in y}zset([x for x in y if x == m])z{x for x in y if x == m}zset([x for x in y for a in b])z{x for x in y for a in b}zset([f(x) - 23 for x in y])z{f(x) - 23 for x in y}rRrSs   rtest_listcompszTest_set_literal.test_listcompss% 

1a/*

1a0+

1a-(

1arcrd}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||d}d}|||d
}d}|||dS)Nzset( [1, 2])z{1, 2}z
set([1 ,  2])z{1 ,  2}z
set([ 1 ])z{ 1 }z
set( [1] )rzset([  1,  2  ])z{  1,  2  }zset([x  for x in y ])z{x  for x in y }z<set(
                   [1, 2]
               )
            z{1, 2}
rRrSs   rrz Test_set_literal.test_whitespaces

1a

1a

1a

1a"

1a'"

1a



1arcnd}d}|||d}d}|||dS)Nzset((1, 2)) # Hiz{1, 2} # HizZ
            # Foo
            set( # Bar
               (1, 2)
            )
            z2
            # Foo
            {1, 2}
            rRrSs   rr/zTest_set_literal.test_commentssJ"

1a

	

1arcd}||d}||d}||d}||d}||d}||dS)Nzset()zset(a)zset(a, b, c)zset(x for x in y)zset(x for x in y if z)zset(a*823-23**2 + f(23))r2rs  rrzTest_set_literal.test_unchangedsqqq
$q(q*qrN)	rLr=rMrrVrrr/rr;rrrrsfE!!!F"@$rrc6eZdZdZdZdZdZdZdZdZ	dS)	Test_sys_excsys_excc:d}d}|||dS)Nzsys.exc_typezsys.exc_info()[0]rRrSs   rrzTest_sys_exc.test_0s&

1arc:d}d}|||dS)Nz
sys.exc_valuezsys.exc_info()[1]rRrSs   rr`zTest_sys_exc.test_1	s&

1arc:d}d}|||dS)Nzsys.exc_tracebackzsys.exc_info()[2]rRrSs   rrbzTest_sys_exc.test_2s&

1arc:d}d}|||dS)Nzsys.exc_type # Foozsys.exc_info()[0] # FoorRrSs   rrezTest_sys_exc.test_3s& %

1arc:d}d}|||dS)Nzsys.  exc_typezsys.  exc_info()[0]rRrSs   rrgzTest_sys_exc.test_4&!

1arc:d}d}|||dS)Nzsys  .exc_typezsys  .exc_info()[0]rRrSs   rrizTest_sys_exc.test_5rrN)
rLr=rMrrr`rbrergrir;rrrrssE




rrcZeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdS)
Test_parenparenc:d}d}|||dS)Nz[i for i in 1, 2 ]z[i for i in (1, 2) ]rRrSs   rrzTest_paren.test_0&s&$&

1arc:d}d}|||dS)Nz[i for i in 1, 2, ]z[i for i in (1, 2,) ]rRrSs   rr`zTest_paren.test_1+s&%'

1arc:d}d}|||dS)Nz[i for i  in     1, 2 ]z[i for i  in     (1, 2) ]rRrSs   rrbzTest_paren.test_20s&)+

1arc:d}d}|||dS)Nz[i for i in 1, 2 if i]z[i for i in (1, 2) if i]rRrSs   rrezTest_paren.test_35s&(*

1arc:d}d}|||dS)Nz[i for i in 1,    2    ]z[i for i in (1,    2)    ]rRrSs   rrgzTest_paren.test_4:s&*,

1arc:d}d}|||dS)Nz(i for i in 1, 2)(i for i in (1, 2))rRrSs   rrizTest_paren.test_5?s&#%

1arc:d}d}|||dS)Nz(i for i in 1   ,2   if i)z(i for i in (1   ,2)   if i)rRrSs   rrlzTest_paren.test_6Ds&,.

1arc4d}||dS)Nz[i for i in (1, 2)]r2rs  rtest_unchanged_0zTest_paren.test_unchanged_0Ir:rc4d}||dS)Nz[i for i in foo()]r2rs  rrzTest_paren.test_unchanged_1Mr~rc4d}||dS)Nz[i for i in (1, 2) if nothing]r2rs  rrzTest_paren.test_unchanged_2Qrrc4d}||dS)Nrr2rs  rrzTest_paren.test_unchanged_3Ur:rc4d}||dS)Nz[i for i in m]r2rs  rrzTest_paren.test_unchanged_4YrrN)rLr=rMrrr`rbrergrirlrrrrrr;rrrr#sE






rrc$eZdZdZdZdZdZdS)Test_metaclass	metaclassc|d|d|d|d|d|d|dd}||d	}||dS)
Nzclass X(): passzclass X(object): passzclass X(object1, object2): passz(class X(object1, object2, object3): passzclass X(metaclass=Meta): passz'class X(b, arg=23, metclass=Meta): passz2class X(b, arg=23, metaclass=Meta, other=42): passzD
        class X:
            def __metaclass__(self): pass
        z1
        class X:
            a[23] = 74
        r2rs  rrzTest_metaclass.test_unchangedas())).///8999ABBB6777@AAAKLLL
	
q
	
qrcnd}d}|||d}d}|||dS)NzQ
        class X:
            # hi
            __metaclass__ = AppleMeta
        zQ
        class X(metaclass=AppleMeta):
            # hi
            pass
        zR
        class X:
            __metaclass__ = Meta
            # Bedtime!
        zR
        class X(metaclass=Meta):
            pass
            # Bedtime!
        rRrSs   rr/zTest_metaclass.test_commentsvsP



	

1a



	

1arcBd}d}|||d}d}|||d}d}|||d}d}|||d	}d}|||d
}d}|||d}d
}|||d}d}|||d}d}|||d}d}|||d}d}|||dS)NzK
        class X():
            __metaclass__ = Q
            pass
        z8
        class X(metaclass=Q):
            pass
        z"class X(object): __metaclass__ = Qz"class X(object, metaclass=Q): passzW
        class X(object):
            __metaclass__ = Meta
            bar = 7
        zF
        class X(object, metaclass=Meta):
            bar = 7
        zJ
        class X:
            __metaclass__ = Meta; x = 4; g = 23
        zD
        class X(metaclass=Meta):
            x = 4; g = 23
        zW
        class X(object):
            bar = 7
            __metaclass__ = Meta
        zl
        class X():
            __metaclass__ = A
            __metaclass__ = B
            bar = 7
        z;
        class X(metaclass=B):
            bar = 7
        z[
        class X(clsA, clsB):
            __metaclass__ = Meta
            bar = 7
        zJ
        class X(clsA, clsB, metaclass=Meta):
            bar = 7
        z(class m(a, arg=23): __metaclass__ = Metaz(class m(a, arg=23, metaclass=Meta): passzN
        class X(expression(2 + 4)):
            __metaclass__ = Meta
        zN
        class X(expression(2 + 4), metaclass=Meta):
            pass
        zT
        class X(expression(2 + 4), x**4):
            __metaclass__ = Meta
        zT
        class X(expression(2 + 4), x**4, metaclass=Meta):
            pass
        zT
        class X:
            __metaclass__ = Meta
            save.py = 23
        zC
        class X(metaclass=Meta):
            save.py = 23
        rRrSs   r	test_metazTest_metaclass.test_metas


	

1a
54

1a


	

1a

	

1a


	

1a

	

1a


	

1a
;:

1a

	

1a

	

1a


	

1arN)rLr=rMrrr/rr;rrrr]sKE*2ppppprrc0eZdZdZdZdZdZdZdZdS)Test_getcwdugetcwducd}d}|||d}d}|||d}d}|||d}d}|||dS)	Nz
os.getcwduz	os.getcwdzos.getcwdu()os.getcwd()zmeth = os.getcwduzmeth = os.getcwdzos.getcwdu(args)zos.getcwd(args)rRrSs   rrVzTest_getcwdu.test_basics

1a

1a#"

1a"!

1arc:d}d}|||dS)Nzos.getcwdu() # Foozos.getcwd() # FoorRrSs   rrzTest_getcwdu.test_commentrrcd}||d}||d}||dS)Nrz	getcwdu()zos.getcwdb()r2rs  rrzTest_getcwdu.test_unchangedsMqqqrc:d}d}|||dS)Nz<
            if 1:
                os.getcwdu()
            z;
            if 1:
                os.getcwd()
            rRrSs   rtest_indentationzTest_getcwdu.test_indentation&rjrcd}d}|||d}d}|||d}d}|||dS)Nz
os .getcwdu()zos .getcwd()zos.  getcwduzos.  getcwdzos.getcwdu (  )zos.getcwd (  )rRrSs   rtest_multilationzTest_getcwdu.test_multilation1sb

1a

1a! 

1arN)	rLr=rMrrVrrrrr;rrrrsdE"
			rrcfeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdS)
Test_operatoroperatorc:d}d}|||dS)Nzoperator.isCallable(x)zcallable(x)rRrSs   rtest_operator_isCallablez&Test_operator.test_operator_isCallableCs&$

1arcd}d}|||d}d}|||d}d}|||dS)Nzoperator.sequenceIncludes(x, y)zoperator.contains(x, y)z operator .sequenceIncludes(x, y)zoperator .contains(x, y)z!operator.  sequenceIncludes(x, y)zoperator.  contains(x, y)rRrSs   rtest_operator_sequenceIncludesz,Test_operator.test_operator_sequenceIncludesHsb-%

1a.&

1a/'

1arc:d}d}|||dS)Nzoperator.isSequenceType(x)z>import collections.abc
isinstance(x, collections.abc.Sequence)rRrSs   rtest_operator_isSequenceTypez*Test_operator.test_operator_isSequenceTypeUs&(M

1arc:d}d}|||dS)Nzoperator.isMappingType(x)z=import collections.abc
isinstance(x, collections.abc.Mapping)rRrSs   rtest_operator_isMappingTypez)Test_operator.test_operator_isMappingTypeZs&'L

1arc:d}d}|||dS)Nzoperator.isNumberType(x)z,import numbers
isinstance(x, numbers.Number)rRrSs   rtest_operator_isNumberTypez(Test_operator.test_operator_isNumberType_s&&;

1arcd}d}|||d}d}|||d}d}|||dS)Nzoperator.repeat(x, n)zoperator.mul(x, n)zoperator .repeat(x, n)zoperator .mul(x, n)zoperator.  repeat(x, n)zoperator.  mul(x, n)rRrSs   rtest_operator_repeatz"Test_operator.test_operator_repeatdsb# 

1a$!

1a%"

1arcd}d}|||d}d}|||d}d}|||dS)Nzoperator.irepeat(x, n)zoperator.imul(x, n)zoperator .irepeat(x, n)zoperator .imul(x, n)zoperator.  irepeat(x, n)zoperator.  imul(x, n)rRrSs   rtest_operator_irepeatz#Test_operator.test_operator_irepeatqsb$!

1a%"

1a&#

1arc:d}d}|||dS)Nz
isCallable(x)z"You should use 'callable(x)' here.rWrrts   rtest_bare_isCallablez"Test_operator.test_bare_isCallable~s(0Q"""""rc:d}d}|||dS)NzsequenceIncludes(x, y)z.You should use 'operator.contains(x, y)' here.rWrs   rtest_bare_sequenceIncludesz(Test_operator.test_bare_sequenceIncludess($<Q"""""rc:d}d}|||dS)NzisSequenceType(z)z>You should use 'isinstance(z, collections.abc.Sequence)' here.rWrs   r!test_bare_operator_isSequenceTypez/Test_operator.test_bare_operator_isSequenceTypes(LQ"""""rc:d}d}|||dS)NzisMappingType(x)z=You should use 'isinstance(x, collections.abc.Mapping)' here.rWrs   r test_bare_operator_isMappingTypez.Test_operator.test_bare_operator_isMappingTypes(KQ"""""rc:d}d}|||dS)NzisNumberType(y)z4You should use 'isinstance(y, numbers.Number)' here.rWrs   rtest_bare_operator_isNumberTypez-Test_operator.test_bare_operator_isNumberTypes(BQ"""""rc:d}d}|||dS)Nzrepeat(x, n)z)You should use 'operator.mul(x, n)' here.rWrs   rtest_bare_operator_repeatz'Test_operator.test_bare_operator_repeats(7Q"""""rc:d}d}|||dS)Nzirepeat(y, 187)z,You should use 'operator.imul(y, 187)' here.rWrs   rtest_bare_operator_irepeatz(Test_operator.test_bare_operator_irepeats(:Q"""""rN)rLr=rMrrrrrrrrrrrrrrrr;rrrr?sE



###
###
###
###
###
###
#####rrc<eZdZdZdZdZdZdZdZdZ	dZ
d	S)

Test_exitfuncexitfuncc:d}d}|||dS)NzI
            import sys
            sys.exitfunc = my_atexit
            ze
            import sys
            import atexit
            atexit.register(my_atexit)
            rRrSs   rr&zTest_exitfunc.test_simple,


	

1arc:d}d}|||dS)NzO
            import sys, crumbs
            sys.exitfunc = my_func
            zY
            import sys, crumbs, atexit
            atexit.register(my_func)
            rRrSs   rtest_names_importzTest_exitfunc.test_names_importrjrc:d}d}|||dS)Nzh
            import sys
            sys.exitfunc = do(d)/a()+complex(f=23, g=23)*expression
            z
            import sys
            import atexit
            atexit.register(do(d)/a()+complex(f=23, g=23)*expression)
            rRrSs   rtest_complex_expressionz%Test_exitfunc.test_complex_expressionrrcnd}d}|||d}d}|||dS)NzN
            import sys # Foo
            sys.exitfunc = f # Blah
            zj
            import sys
            import atexit # Foo
            atexit.register(f) # Blah
            zo
            import apples, sys, crumbs, larry # Pleasant comments
            sys.exitfunc = func
            zy
            import apples, sys, crumbs, larry, atexit # Pleasant comments
            atexit.register(func)
            rRrSs   rr/zTest_exitfunc.test_commentssP


	

1a

	

1arc:d}d}|||dS)Nz]
            import sys
            def f():
                sys.exitfunc = func
            zz
            import sys
            import atexit
            def f():
                atexit.register(func)
             rRrSs   rtest_in_a_functionz Test_exitfunc.test_in_a_functions,


	

1arc@d}d}d}||||dS)Nzsys.exitfunc = fzatexit.register(f)zKCan't find sys import; Please add an atexit import at the top of your file.r3)rrTrUmsgs    rtest_no_sys_importz Test_exitfunc.test_no_sys_imports/"$ 

1arc4d}||dS)Nzf(sys.exitfunc)r2rs  rrzTest_exitfunc.test_unchangedrrN)rLr=rMrr&rrr/rrrr;rrrrsE


			


,rrc$eZdZdZdZdZdZdS)Test_assertsassertscJgd}|D]\}}|||dS)N))zself.assert_(True)self.assertTrue(True))zself.assertEquals(2, 2)self.assertEqual(2, 2))zself.assertNotEquals(2, 3)self.assertNotEqual(2, 3))zself.assertAlmostEquals(2, 3)self.assertAlmostEqual(2, 3))z self.assertNotAlmostEquals(2, 8)self.assertNotAlmostEqual(2, 8))zself.failUnlessEqual(2, 2)r)zself.failIfEqual(2, 3)r)z self.failUnlessAlmostEqual(2, 3)r)zself.failIfAlmostEqual(2, 8)r)zself.failUnless(True)r)zself.failUnlessRaises(foo)zself.assertRaises(foo))zself.failIf(False)zself.assertFalse(False)rR)rtestsrTrUs    rtest_deprecated_namesz"Test_asserts.test_deprecated_namessI





		DAqJJq!		rcrd}d}|||d}d}|||d}d}|||d}d}|||d	}d
}|||d}d}|||d
}d}|||dS)Nzeq = self.assertEqualszeq = self.assertEqualz#self.assertEquals(2, 3, msg="fail")z"self.assertEqual(2, 3, msg="fail")z)self.assertEquals(2, 3, msg="fail") # fooz(self.assertEqual(2, 3, msg="fail") # foozself.assertEquals (2, 3)zself.assertEqual (2, 3)z  self.assertEquals (2, 3)z  self.assertEqual (2, 3)z0with self.failUnlessRaises(Explosion): explode()z,with self.assertRaises(Explosion): explode()z6with self.failUnlessRaises(Explosion) as cm: explode()z2with self.assertRaises(Explosion) as cm: explode()rRrSs   r
test_variantszTest_asserts.test_variantss$#

1a10

1a76

1a&%

1a('

1a>:

1aD@

1arcZ|d|ddS)Nzself.assertEqualsOnSaturdayz!self.assertEqualsOnSaturday(3, 5)r2rs rrzTest_asserts.test_unchanged's.4555:;;;;;rN)rLr=rMrrrrr;rrrrsFE$.<<<<<rr)BrJrrrrr
rr
lib2to3.testsrTestCaser	rOr]rzrrrrrrr rCrorrrrrrrr+rArHrarmrqrrrrrrArKrqrrrrrrrrr
rrr)r=rrrrrrrrr;rr<module>rsh
(
			'&&&&&&&!!!!!!7N7N7N7N7NG$7N7N7Nrm688888=888tCCCCCCCCJ99999-999v/////-///b!!!!!-!!!FggggggggT11111
111f$$$$$
$$$LQQQQQ-QQQf}}}}}}}}~{{{{{{{{z+++++
+++\#####M###L44444m4448ddddd
dddLF7F7F7F7F7-F7F7F7P					m			-----]---^]4(((((m(((V________D="3*88888M#4888

-
-
-
-
-}.?
-
-
- o%o%o%o%o%-o%o%o%d--------^yyyyy
yyyv}@XXXXX
XXXt22222=222h@@@@@}@@@D,,,,,=,,,\LLLLL=LLL^fffff-fffPzzzzz}zzzxNNNNN}NNN` @VVVVV-VVVp
m-(((((-(((&:7:7:7:7:7]:7:7:7zGGGGG]GGGTaaaaa-aaaH|||||}|||~=D88888888tbbbbb]bbbJ:::::=:::z`#`#`#`#`#M`#`#`#FUUUUUMUUUp/</</</</<=/</</</</<r