ϪfdZddlmZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ed Zd Zdd ZGd d e j"Zy)z* Tests for the output generated by trial. ) annotationsN)StringIO)TypeVar)trial)runner)packages_TzNo module named 'frotz'c"ddlm}tj}|j |t }t j|j||d}tj|}|j||jS)Nr)reporterztemp-directory)streamworkingDirectory) twisted.trialr rOptions parseOptionsrr TrialRunnerVerboseTextReporter _getSuiterungetvalue)argsr configoutputmyRunnersuites @/usr/lib/python3/dist-packages/twisted/trial/test/test_output.pyrunTrialrss& ]]_F  ZF!!$$ 01H OOF #E LL ?? ceZdZdZddZdZddZddZ dfd Z dfd Z ddZ dd Z dd Z dd Z dd Zdd ZddZddZddZddZddZddZddZddZxZS)ImportErrorsTestszbActually run trial as if on the command line and check that the output is what we expect. cyNselfs rdebugzImportErrorsTests.debug+s r_testImportErrorsc8td|jg|S)Nz--temp-directory)rmktemp)r$rs rrzImportErrorsTests.runTrial0s*DKKMADAArct||Sr!)print)r$stuffs r_printzImportErrorsTests._print3s e  rc0t|||g|i||Sr!)superassertInr$ container containeerkwargs __class__s rr/zImportErrorsTests.assertIn7s$ I???rc0t|||g|i||Sr!)r. assertNotInr0s rr6zImportErrorsTests.assertNotIn>s$ IyB4B6Brc$|jyr!)rr#s r test_trialRunzImportErrorsTests.test_trialRunEs  rcp|jd}|j|d|j|d|S)Nztwisted.doesntexist[ERROR]rr/r$ds rtest_nonexistentModulez(ImportErrorsTests.test_nonexistentModuleHs3 MM/ 0 a# a./rc|jd}|j|d|j|d|j|d|S)N doesntexistModuleNotFoundr:r;r<s rtest_nonexistentPackagez)ImportErrorsTests.test_nonexistentPackageNs@ MM- ( a' a)* a#rc|jd}|j|d|j|d|j|d|S)Nzdoesntexist.barneyObjectNotFoundr:r;r<s r!test_nonexistentPackageWithModulez3ImportErrorsTests.test_nonexistentPackageWithModuleUsB MM. / a-. a)* a#rc|jd}|j|d|j|d|j|d|S)N badpackager:IOErrorrr/r6r<s rtest_badpackagez!ImportErrorsTests.test_badpackage\sA MM, ' a# a& I&rc|jd}|j|d|j|d|j|d|S)Nzbadpackage.test_moduler:rHrIr<s rtest_moduleInBadpackagez)ImportErrorsTests.test_moduleInBadpackagecsC MM2 3 a# a12 I&rc|jd}|j|d|j|d|j|d|j|d|S)Nzpackage.test_bad_moduler:rHrBrErJrLrOrQrVr\r^rbrkrm __classcell__)r4s@rrr&s !FB),5;GM ),5;GM  rrrp)rv __future__rrgiortypingrtwisted.scriptsrrrtwisted.trial.testrr r[rSysPathManglingTestrr"rrr~sH# ! ' T]*  G44Gr