#!/usr/bin/env python3 """Microbenchmark on ignored warning. https://bugs.python.org/issue27535 """ import perf from six.moves import xrange import _testcapi import warnings if __name__ == "__main__": runner = perf.Runner() runner.metadata['description'] = ("Measure the performance of emitting " "a warning which is ignored") # Ignore warnings warnings.simplefilter("ignore") runner.bench_time_func('emit_warning', _testcapi.bench)