本文整理匯總了Python中nose.plugins.doctests.Doctest.enabled方法的典型用法代碼示例。如果您正苦於以下問題:Python Doctest.enabled方法的具體用法?Python Doctest.enabled怎麽用?Python Doctest.enabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nose.plugins.doctests.Doctest
的用法示例。
在下文中一共展示了Doctest.enabled方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _perform_the_testrun
# 需要導入模塊: from nose.plugins.doctests import Doctest [as 別名]
# 或者: from nose.plugins.doctests.Doctest import enabled [as 別名]
def _perform_the_testrun(self, directories, results_queue, previous_report = None):
try:
ensure_mpd_is_running()
null_device = open('/dev/null')
os.stdin = null_device
report = MakeAReportOfATestRun(previous_report, results_queue)
doctest = Doctest()
doctest.enabled = True
plugins = [doctest, report, Skip(), Capture()]
argv = ['nose', '-v']
old_working_directory = os.getcwd()
if not self.WORKING_DIRECTORY is None:
argv.extend(['-w', self.WORKING_DIRECTORY])
os.chdir(self.WORKING_DIRECTORY)
argv.extend( directories)
argv.extend(['--with-doctest', '--doctest-extension=txt'])
result = TestProgram(exit = False, argv=argv, plugins=plugins);
os.chdir(old_working_directory)
results_queue.put(('test-report', report,) )
except :
results_queue.put(('test-error', 'Exception happened: ' + str(sys.exc_info()[0]) + " - " + str(sys.exc_info()[1]), ))
finally:
results_queue.put(None)
MPI.Finalize()