��Qc@�s�ddlmZddlZddlZeadejfd��YZdej fd��YZ
d�Zd�Ze
d kr�e�ndS(
i�(twith_statementNtMyConnectioncB�seZd�ZRS(cC�statjj|�dS(N(tTruetdid_rollbacktsqlitet
Connectiontrollback(tself((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyRs(t__name__t
__module__R(((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyRstContextTestscB�s5eZd�Zd�Zd�Zd�Zd�ZRS(cC�s2tjddt�|_|jjd�tadS(Ns:memory:tfactoryscreate table test(c unique)(RtconnectRtcontexecutetFalseR(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytsetUp%scC�s|jj�dS(N(R
tclose(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyttearDown+scC�s|j�WdQXdS(s7Can the connection be used as a context manager at all?N(R
(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytCheckContextManager.s
cC�s]|j�|jjd�WdQX|jj�|jjd�j�d}|j|d�dS(s*Is a commit called in the context manager?s"insert into test(c) values ('foo')Nsselect count(*) from testii(R
RRtfetchonetassertEqual(Rtcount((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytCheckContextManagerCommit3s
cC�so|jtt�y4|j�|jjd�|jjd�WdQXWntjk
rZnX|jtt�dS(s,Is a rollback called in the context manager?sinsert into test(c) values (4)N(RRRR
RRtIntegrityErrorR(R((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytCheckContextManagerRollback;s
(RR RRRRR(((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyR
$s
cC�s"tjtd�}tj|f�S(NtCheck(tunittestt makeSuiteR
t TestSuite(t ctx_suite((s,/sys/lib/python2.7/sqlite3/test/py25tests.pytsuiteGscC�s tj�}|jt��dS(N(RtTextTestRunnertrunR(trunner((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyttestKst__main__(t
__future__RRtsqlite3RRRRRtTestCaseR
RR#R(((s,/sys/lib/python2.7/sqlite3/test/py25tests.pyt<module>s#
|