Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self_time=0.5,
),
Frame(
identifier='strip_newlines\x00cibuildwheel/utils.py\x00997',
self_time=0.5,
),
Frame(
identifier='calculate_metrics\x00cibuildwheel/utils.py\x007',
self_time=0.01,
),
]
)
assert frame.time() == approx(11.01)
frame = processors.remove_irrelevant_nodes(frame, options={})
assert frame.time() == approx(11.01)
# check the calculate metrics function was deleted
assert len(frame.children) == 3
assert 'calculate_metrics' not in [f.function for f in frame.children]
import sys
from pyinstrument import processors
from pyinstrument.frame import Frame, SelfTimeFrame
from pytest import approx
all_processors = [
processors.aggregate_repeated_calls,
processors.group_library_frames_processor,
processors.merge_consecutive_self_time,
processors.remove_importlib,
processors.remove_unnecessary_self_time_nodes,
processors.remove_irrelevant_nodes,
]
def test_remove_importlib():
frame = Frame(
identifier='\x00sympy/__init__.py\x0012',
children=[
Frame(
identifier='_handle_fromlist\x00../\x00997',
self_time=0.1,
children=[
Frame(
identifier='_find_and_load\x00../\x00997',
self_time=0.1,
children=[
Frame(
identifier='\x00sympy/polys/polyfuncs.py\x001',
def default_processors(self):
return [
processors.remove_importlib,
processors.merge_consecutive_self_time,
processors.aggregate_repeated_calls,
processors.group_library_frames_processor,
processors.remove_unnecessary_self_time_nodes,
processors.remove_irrelevant_nodes,
]
def default_processors(self):
return [
processors.remove_importlib,
processors.merge_consecutive_self_time,
processors.aggregate_repeated_calls,
processors.group_library_frames_processor,
processors.remove_unnecessary_self_time_nodes,
processors.remove_irrelevant_nodes,
]
def default_processors(self):
return [
processors.remove_importlib,
processors.merge_consecutive_self_time,
processors.aggregate_repeated_calls,
processors.group_library_frames_processor,
processors.remove_unnecessary_self_time_nodes,
processors.remove_irrelevant_nodes,
]