ACC SHELL

Path : /usr/lib/python/lib2to3/tests/
File Upload :
Current File : //usr/lib/python/lib2to3/tests/test_parser.pyc

Ñò
sÄMc
@sIdZddklZddklZlZddkZddkZddkZddkl	Z	ddk
lZd	eifd
„ƒYZ
de
fd„ƒYZd
e
fd„ƒYZde
fd„ƒYZde
fd„ƒYZde
fd„ƒYZde
fd„ƒYZdeifd„ƒYZde
fd„ƒYZd„ZdS(sFTest suite for 2to3's parser and grammar files.

This is the place to add tests for changes to 2to3's grammar, such as those
merging the grammars for Python 2 and 3. In addition to specific tests for
parts of the grammar we've changed, we also make sure we can parse the
test_grammar.py files from both Python 2 and Python 3.
i(tsupport(tdriverttest_diriÿÿÿÿN(ttokenizei(t
ParseErrortGrammarTestcBseZd„Zd„ZRS(cCsti|ƒdS(N(Rtparse_string(tselftcode((s//usr/lib/python2.6/lib2to3/tests/test_parser.pytvalidatescCs7y|i|ƒWntj
onXtdƒ‚dS(Ns Syntax shouldn't have been valid(R	RtAssertionError(RR((s//usr/lib/python2.6/lib2to3/tests/test_parser.pytinvalid_syntaxs
(t__name__t
__module__R	R(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRs	tTestRaiseChangescBsYeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	cCs|idƒdS(Ntraise(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_2x_style_1%scCs|idƒdS(Ns
raise E, V(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_2x_style_2(scCs|idƒdS(Ns
raise E, V, T(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_2x_style_3+scCs|idƒdS(Nsraise E, V, T, Z(R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_2x_style_invalid_1.scCs|idƒdS(Nsraise E1 from E2(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyt
test_3x_style1scCs|idƒdS(Nsraise E, V from E1(R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_3x_style_invalid_14scCs|idƒdS(Nsraise E from E1, E2(R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_3x_style_invalid_27scCs|idƒdS(Nsraise from E1, E2(R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_3x_style_invalid_3:scCs|idƒdS(Nsraise E from(R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_3x_style_invalid_4=s(RR
RRRRRRRRR(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR$s								tTestFunctionAnnotationscBsPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(cCs|idƒdS(Nsdef f(x) -> list: pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_1CscCs|idƒdS(Nsdef f(x:int): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_2FscCs|idƒdS(Nsdef f(*x:str): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_3IscCs|idƒdS(Nsdef f(**x:float): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_4LscCs|idƒdS(Nsdef f(x, y:1+2): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_5OscCs|idƒdS(Nsdef f(a, (b:1, c:2, d)): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_6RscCs|idƒdS(Ns/def f(a, (b:1, c:2, d), e:3=4, f=5, *g:6): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_7UscCsd}|i|ƒdS(Nsgdef f(a, (b:1, c:2, d), e:3=4, f=5,
                        *g:6, h:7, i=8, j:9=10, **k:11) -> 12: pass(R	(Rts((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_8Xs(
RR
RRRRRRR R"(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRBs							t
TestExceptcBseZd„Zd„ZRS(cCsd}|i|ƒdS(NsP
            try:
                x
            except E as N:
                y(R	(RR!((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_new_scCsd}|i|ƒdS(NsN
            try:
                x
            except E, N:
                y(R	(RR!((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_oldgs(RR
R$R%(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR#^s	tTestSetLiteralcBs,eZd„Zd„Zd„Zd„ZRS(cCs|idƒdS(Nsx = {'one'}(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRrscCs|idƒdS(Nsx = {'one', 1,}(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRuscCs|idƒdS(Nsx = {'one', 'two', 'three'}(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRxscCs|idƒdS(Nsx = {2, 3, 4,}(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR{s(RR
RRRR(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR&qs			tTestNumericLiteralscBseZd„Zd„ZRS(cCs|idƒ|idƒdS(Nt0o7777777777777t0o7324528887(R	R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_new_octal_notation€s
cCs|idƒ|idƒdS(Nt0b101010t	0b0101021(R	R(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_new_binary_notation„s
(RR
R*R-(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR's	tTestClassDefcBseZd„ZRS(cCsE|idƒ|idƒ|idƒ|idƒ|idƒdS(Nsclass B(t=7): passsclass B(t, *args): passsclass B(t, **kwargs): passs!class B(t, *args, **kwargs): passs&class B(t, y=9, *args, **kwargs): pass(R	(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_new_syntaxŠs




(RR
R/(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR.‰stTestParserIdempotencycBs eZdZd„Zd„ZRS(s,A cut-down version of pytree_idempotency.py.c	CstiidƒodSxôtiƒD]æ}t|dƒiiƒ}z#|~}ti	|i
ƒd}WdQX|i|dj	d|ƒt
i|dd|ƒiiƒ}z|~}|iƒ}WdQXti|ƒ}t|ƒ}t|||ƒo|id|ƒq%q%WdS(Ntwintrbiscan't detect encoding for %strtencodingsIdempotency failed: %s(tsystplatformt
startswithRtall_project_filestopent__exit__t	__enter__Rtdetect_encodingtreadlinet
assertTruetNonetiotreadRRtunicodetdifftfail(	Rtfilepatht_[1]tfpR4t_[2]tsourcettreetnew((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_all_project_files–s
&/cCs8tidƒtidƒtidƒtidƒdS(Ns
a, *b, c = x
s[*a, b] = x
s(z, *y, w) = m
sfor *z, m in d: pass
(RR(R((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_extended_unpacking¦s


(RR
t__doc__RLRM(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR0’s	tTestLiteralscBs,eZd„Zd„Zd„Zd„ZRS(cCstiti|ƒdƒdS(Ns

(RRRtdedent(RR!((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyR	®scCsd}|i|ƒdS(Nsá
            md5test(b"ª" * 80,
                    (b"Test Using Larger Than Block-Size Key "
                     b"and Larger Than One Block-Size Data"),
                    "6f630fad67cda0ee1fb1f562db3aa53e")
            (R	(RR!((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_multiline_bytes_literals±scCsd}|i|ƒdS(Ns¬
            b"""
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN">
            """
            (R	(RR!((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyt'test_multiline_bytes_tripquote_literalsºscCsd}|i|ƒdS(NsÞ
            md5test("ª" * 80,
                    ("Test Using Larger Than Block-Size Key "
                     "and Larger Than One Block-Size Data"),
                    "6f630fad67cda0ee1fb1f562db3aa53e")
            (R	(RR!((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyttest_multiline_str_literalsÃs(RR
R	RQRRRS(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRO¬s					c	Csatiddd|ƒ}z|i|ƒWd|iƒXztid|ƒSWdtidƒXdS(Nt@twR4sdiff -u %r @(R@R9twritetclosetostsystemtremove(tfntresultR4tf((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyRCÍs(RNtRRRRXR@R5t
lib2to3.pgen2Rtpgen2.parseRtTestCaseRRRR#R&R'R.R0RORC(((s//usr/lib/python2.6/lib2to3/tests/test_parser.pyt<module>s"

	!

ACC SHELL 2018