本文整理汇总了Python中pywikibot.data.api.CachedRequest._make_dir方法的典型用法代码示例。如果您正苦于以下问题:Python CachedRequest._make_dir方法的具体用法?Python CachedRequest._make_dir怎么用?Python CachedRequest._make_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pywikibot.data.api.CachedRequest
的用法示例。
在下文中一共展示了CachedRequest._make_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_tests
# 需要导入模块: from pywikibot.data.api import CachedRequest [as 别名]
# 或者: from pywikibot.data.api.CachedRequest import _make_dir [as 别名]
test_list.append(module_class_name)
tests = loader.loadTestsFromNames(test_list)
suite = unittest.TestSuite()
suite.addTests(tests)
return suite
def load_tests(loader=unittest.loader.defaultTestLoader,
tests=None, pattern=None):
"""Load the default modules."""
return collector(loader)
CachedRequest._get_cache_dir = staticmethod(
lambda *args: CachedRequest._make_dir(_cache_dir))
# Travis-CI builds are set to retry twice, which aims to reduce the number
# of 'red' builds caused by intermittant server problems, while also avoiding
# the builds taking a long time due to retries.
# The following allows builds to retry twice, but higher default values are
# overridden here to restrict retries to only 1, so developer builds fail more
# frequently in code paths resulting from mishandled server problems.
if config.max_retries > 2:
print('max_retries reduced from %d to 1 for tests' % config.max_retries)
config.max_retries = 1
cache_misses = 0
cache_hits = 0