U eT @srdZddlmZddlmZddlZddlZddlZee Z GdddeZ GdddZ Gd d d ej Z dS) a  This plugin bypasses the actual execution of tests, and instead just collects test names. Fixtures are also bypassed, so running nosetests with the collection plugin enabled should be very quick. This plugin is useful in combination with the testid plugin (``--with-id``). Run both together to get an indexed list of all tests, which will enable you to run individual tests by index number. This plugin is also useful for counting tests in a test suite, and making people watching your demo think all of your tests pass. )Plugin)TestNc@s0eZdZdZdZdZddZddZdd Zd S) CollectOnlyzB Collect and output test names only, don't run any tests. z collect-onlyZ collect_onlycCs(|jdd|j|dd|ddS)z&Register commandline options. z--collect-only store_trueZNOSE_COLLECT_ONLYz&Enable collect-only: %s [COLLECT_ONLY])actiondestdefaulthelpN) add_option enableOptgetr )selfparserenvrB/opt/hc_python/lib/python3.8/site-packages/nose/plugins/collect.pyoptionsszCollectOnly.optionscCstdt|j|_dS)z8Install collect-only suite class in TestLoader. zPreparing test loaderN)logdebugTestSuiteFactoryconfZ suiteClass)r loaderrrrprepareTestLoader's zCollectOnly.prepareTestLoadercs,tdttsdSfdd}|S)z;Replace actual test with dummy that always passes. zPreparing test case %sNcsLjj|jj|jj|dSN)rpluginsZ startTestZ addSuccessZstopTest)resultr testrrrun5s   z(CollectOnly.prepareTestCase..run)rr isinstancer)r rrrrrprepareTestCase.s    zCollectOnly.prepareTestCaseN) __name__ __module__ __qualname____doc__namer rrr rrrrrs  rc@s"eZdZdZddZdddZdS) rz7 Factory for producing configured test suites. cCs ||_dSrr)r rrrr__init__EszTestSuiteFactory.__init__rcKst||jdS)Nr&) TestSuiter)r testskwrrr__call__HszTestSuiteFactory.__call__N)r)r!r"r#r$r'r+rrrrrAsrc@s"eZdZdZdddZddZdS) r(z Basic test suite that bypasses most proxy and plugin calls, but does wrap tests in a nose.case.Test so prepareTestCase will be called. rNcCs6||_t|tjr|}td|tj||dS)Nz TestSuite(%r)) rr collectionsCallablerrunittestr(r')r r)rrrrr'Qs   zTestSuite.__init__cCs@td|t|tjr&|j|n|jt||jddS)Nz Add test %s)config) rrrr.r(Z_testsappendrrrrrraddTestYs  zTestSuite.addTest)rN)r!r"r#r$r'r1rrrrr(Ls r()r$Znose.plugins.baserZ nose.caserloggingr.r, getLoggerr!rrrr(rrrrs   +