def test_all_exports_correspond_to_plugins(self):
exports = [name for name in dir(tb.summary) if not name.startswith('_')]
futures = frozenset(('absolute_import', 'division', 'print_function'))
bad_exports = [
name for name in exports
if name not in futures and not any(
name == plugin or name.startswith('%s_' % plugin)
for plugin in STANDARD_PLUGINS)
]
if bad_exports:
self.fail(
'The following exports do not correspond to known standard '
'plugins: %r. Please mark these as private by prepending an '
'underscore to their names, or, if they correspond to a new '
'plugin that you are certain should be part of the public API '
'forever, add that plugin to the STANDARD_PLUGINS set in this '
'module.' % bad_exports)
评论列表
文章目录