本文整理汇总了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()