Skip to content

Instantly share code, notes, and snippets.

@willingc
Created July 29, 2025 16:26
Show Gist options
  • Save willingc/07601d2d8515d606d9a09d444edab3c4 to your computer and use it in GitHub Desktop.
Save willingc/07601d2d8515d606d9a09d444edab3c4 to your computer and use it in GitHub Desktop.

Pytest Fixture Usage Analysis

This report shows which pytest fixtures are actually used in the napari test suite.

Summary

  • Total unique fixtures used: 370
  • Total fixture usages: 1994
  • Documented fixtures: 58
  • Autouse fixtures (run automatically): 12
  • Unused documented fixtures: 8
  • Used but undocumented fixtures: 332

Most Used Fixtures

Fixture Usage Count Documented
make_napari_viewer 260
qtbot 251
monkeypatch 76
tmp_path 60
ndim 33
expected 33
data 31
tmp_plugin 29
features 29
attribute 26
builtins 25
create_known_shapes_layer 25
dtype 24
qt_viewer 23
layer_slicer 20
layer 19
tmpdir 18
properties 18
napari_plugin_manager 15
trans 15

Unused Documented Fixtures

These fixtures are documented but not used in any tests (excluding autouse fixtures):

  • _dangling_qanimations
  • _dangling_qthread_pool
  • _dangling_qthreads
  • _dangling_qtimers
  • _disable_jit
  • _disable_throttling
  • _example_monkeypatch
  • qt_viewer_

Autouse Fixtures

These fixtures run automatically for all tests in their scope:

  • _auto_shutdown_dask_threadworkers
  • _clean_themes
  • _clear_cached_action_injection
  • _disable_notification_dismiss_timer
  • _fix_magic_name
  • _fresh_settings
  • _skip_examples
  • colormap_backend
  • mock_npe2_pm
  • npe2pm_
  • pytest_configure
  • use_builtins

Used but Undocumented Fixtures

These fixtures are used in tests but not in our documentation:

Fixture Usage Count Example Location
qtbot 251 ...s/test_multiple_viewers.py::test_multi_viewers_dont_clash
monkeypatch 76 napari/_tests/test_view_layers.py::test_kwargs_passed
tmp_path 60 napari/_tests/test_viewer.py::test_add_layer_magic_name
ndim 33 napari/_tests/test_view_layers.py::test_view
expected 33 ...tests/test_qt_viewer_2.py::test_fix_data_dtype_big_values
data 31 napari/_tests/test_view_layers.py::test_view
features 29 ...st_style_encoding.py::test_scalar_constant_encoding_apply
attribute 26 ..._model.py::test_evented_model_with_property_setter_events
create_known_shapes_layer 25 ...pes_mouse_bindings.py::test_not_adding_or_selecting_shape
dtype 24 napari/_tests/test_dtypes.py::test_image_dytpes
layer_slicer 20 ...ayer_slicer.py::test_submit_with_one_async_layer_no_block
properties 18 ...ts/test_qt_tracks_layer.py::test_tracks_controls_color_by
tmpdir 18 napari/_qt/_tests/test_qt_viewer.py::test_screenshot_dialog
create_known_points_layer_2d 15 ...nts_mouse_bindings.py::test_not_adding_or_selecting_point
trans 15 ...tils/_tests/test_translations.py::test_get_language_packs
mock_pm 14 ...p_model/_tests/test_file_menu.py::test_sample_menu_sorted
Transform 14 ...orms/_tests/test_transform_chain.py::test_transform_chain
mode 14 ...ri/_qt/_tests/test_qt_viewer.py::test_selection_collision
qapp 13 ...ri/_tests/test_conftest_fixtures.py::test_disable_qthread
color 12 ..._color_swatch.py::test_succesfull_create_qcolorswatchedit
Layer 12 napari/_tests/test_adding_removing.py::test_add_all_layers
pref 12 ...sts/test_preferences_dialog.py::test_prefdialog_populated
dims_displayed 12 ..._tests/test_mouse_bindings.py::test_highlight_box_handles
tree 11 napari/utils/tree/_tests/test_tree_model.py::test_tree_str
extension2reader_widget 11 ...st_qt_extension2reader.py::test_extension2reader_defaults
make_labels_controls 11 ...ayer.py::test_changing_layer_color_mode_updates_combo_box
font_size_preview_widget 11 ...e_preview.py::test_qt_size_slider_preview_widget_defaults
kwargs 10 ...components/_tests/test_multichannel.py::test_multichannel
highlight_preview_widget 10 ...ght_preview.py::test_qt_highlight_preview_widget_defaults
AffineType 9 ...ls/transforms/_tests/test_transforms.py::test_empty_units
action_id 9 napari/_qt/_qapp_model/_tests/test_file_menu.py::test_open
layer_list 9 ...tests/test_qaction_layer.py::test_copy_scale_to_clipboard
name 8 napari/_tests/test_magicgui.py::test_mgui_forward_refs
capsys 8 napari/_tests/test_cli.py::test_cli_works
shortcut_editor_widget 8 ..._shortcut_editor_widget.py::test_shortcut_editor_defaults
layer_type_with_data 8 ...sts/test_qt_layer_controls.py::test_create_layer_controls
layer_class 7 napari/_tests/test_viewer.py::test_add_layer
tif_reader 7 ...test_qt_extension2reader.py::test_all_readers_in_dropdown
rng 7 ...slicing.py::test_async_slice_image_on_current_step_change
reader_dialog 7 .../_tests/test_reader_dialog.py::test_reader_dialog_buttons
view_direction 7 napari/layers/points/_tests/test_points.py::test_value_3d
create_known_points_layer_3d 7 ...s/_tests/test_points_mouse_bindings.py::test_add_point_3d
feature_table 7 ...ts/test_layer_utils.py::test_feature_table_resize_smaller
position 6 ..._tests/test_mouse_bindings.py::test_highlight_box_handles
expected_coords 6 .../layers/utils/_tests/test_text_utils.py::test_bbox_center
layer_list_dim2 6 ..._tests/test_qaction_layer.py::test_paste_scale_higher_dim
stack 6 napari/_qt/_tests/test_open_file.py::test_open_files_dialog
shape 6 ...components/_tests/test_multichannel.py::test_multichannel
test_list 6 ...s/_tests/test_evented_list.py::test_list_interface_parity
order 6 ...nts/_tests/test_dims.py::test_reorder_after_dim_reduction
create_layer_controls 6 ...sts/test_qt_layer_controls.py::test_create_layer_controls
scale 6 ..._layer.py::test_node_origin_is_consistent_with_multiscale
triangle_widget 5 ...s/test_qt_highlight_preview.py::test_qt_triangle_defaults
value 5 ..._model.py::test_evented_model_with_property_setter_events
request 5 ...sts/test_plugin_widgets.py::test_dock_widget_registration
world 5 napari/layers/points/_tests/test_points.py::test_value_3d
LayerType 5 napari/_tests/test_magicgui.py::test_get_ndim_from_data
cube_layer 5 ...tests/test_vispy_surface_layer.py::test_VispySurfaceLayer
view_data 5 .../layers/utils/_tests/test_text_utils.py::test_bbox_center
null_data 5 ...ts/test_qt_tracks_layer.py::test_tracks_controls_color_by
meth 5 ...s/_tests/test_evented_list.py::test_list_interface_parity
qt_viewer_buttons 5 ...ts/test_qt_viewer_buttons.py::test_roll_dims_button_popup
dimensionality 5 .../transforms/_tests/test_transforms.py::test_affine_matrix
npy_reader 5 ...tests/test_qt_extension2reader.py::test_filtering_readers
func 5 napari/_tests/test_viewer.py::test_viewer_actions
input_data 5 napari/utils/_tests/test_misc.py::test_sequence_of_iterables
point 5 ...tils/_tests/test_geometry.py::test_project_point_to_plane
ndisplay 5 ...test_viewer_model.py::test_fit_to_view_center_calculation
expectation 5 ...tainers/_tests/test_qt_tree.py::test_nested_move_multiple
recwarn 5 ...sts/test_plugin_widgets.py::test_dock_widget_registration
ref_view 5 ...ets/_tests/test_qt_play.py::test_play_raises_index_errors
bounding_box 4 ..._tests/test_geometry.py::test_clamp_point_to_bounding_box
count_show 4 ...st_qt_notifications.py::test_notification_manager_via_gui
dialog_return 4 napari/_qt/_qapp_model/_tests/test_file_menu.py::test_open
sources 4 ...tainers/_tests/test_qt_tree.py::test_nested_move_multiple
colors 4 ...test_colormaps.py::test_ensure_colormap_with_multi_colors
expected_value 4 ...ts/test_image.py::test_projected_distance_from_mouse_drag
regular_list 4 napari/utils/events/_tests/test_evented_list.py::test_list
write_spec 4 napari_builtins/_tests/test_io.py::test_single_file
action_manager 4 ...s/test_action_manager.py::test_unbind_non_existing_action
dest 4 ...tainers/_tests/test_qt_tree.py::test_nested_move_multiple
dtype_str 4 ...ri/utils/_tests/test_dtype.py::test_normalize_dtype_torch
pos 4 ...dialogs/_tests/test_qt_modal.py::TestQtPopup.test_move_to
list_type 4 ...s/events/_tests/test_typed_list.py::test_type_enforcement
editable_layer 4 ....py::test_make_visible_when_editable_enables_edit_buttons
line_direction 3 ...tests/test_geometry.py::test_intersect_line_with_plane_3d
shape_type 3 ...ests/test_shapes_mouse_bindings.py::test_add_simple_shape
color_cycle 3 napari/layers/points/_tests/test_points.py::test_color_cycle
mock_remove_theme 3 ...de_theme.py::test_provide_theme_hook_registered_correctly
expected_index 3 ...test_geometry.py::test_find_nearest_triangle_intersection
npe2pm 3 .../_tests/test_qt_window.py::test_shimmed_dialog_no_plugins
regular_dict 3 napari/utils/events/_tests/test_evented_dict.py::test_dict
dialog_method 3 napari/_qt/_qapp_model/_tests/test_file_menu.py::test_open
array_type 3 ...y/_tests/test_vispy_labels_layer.py::test_labels_painting
modifier 3 ...shortcut_editor_widget.py::test_keybinding_with_modifiers
ray_start 3 ...test_geometry.py::test_find_nearest_triangle_intersection
ray_direction 3 ...test_geometry.py::test_find_nearest_triangle_intersection
caplog 3 napari/_tests/test_advanced.py::test_update_lazy_console
closed 3 ...tests/test_triangulation.py::test_generate_2D_edge_meshes
regular_set 3 napari/utils/events/_tests/test_evented_set.py::test_set
modifiers 3 ...cut_editor_widget.py::test_keybinding_with_only_modifiers
key_symbols 3 ...shortcut_editor_widget.py::test_keybinding_with_modifiers
test_set 3 ...nts/_tests/test_evented_set.py::test_set_interface_parity
num 3 ...ps/_tests/test_colormap.py::test_minimum_dtype_for_labels
key 3 ...shortcut_editor_widget.py::test_keybinding_with_modifiers
tooltip 3 ...ts/test_qt_event_filters.py::test_qt_tooltip_event_filter
mock_add_theme 3 ...de_theme.py::test_provide_theme_hook_registered_correctly
patch_method 3 ..._qt/_qapp_model/_tests/test_file_menu.py::test_screenshot
border_width 2 ...ers/points/_tests/test_points.py::test_border_width_types
test_dict 2 ...s/_tests/test_evented_dict.py::test_dict_interface_parity
c_props 2 ...sts/test_color_manager.py::test_color_properties_coercion
perfmon_activation 2 ...p_model/_tests/test_debug_menu.py::test_debug_menu_exists
dict_type 2 ...s/events/_tests/test_typed_dict.py::test_type_enforcement
face_normal 2 .../test_geometry.py::test_face_coordinate_from_bounding_box
fname 2 napari/_tests/test_examples.py::test_examples
vec_1 2 ...ts/test_geometry.py::test_rotation_matrix_from_vectors_2d
obj 2 ...els/_tests/test_labels.py::TestLabels.test_events_defined
start_position 2 ...ts/test_image.py::test_projected_distance_from_mouse_drag
params 2 ...egorical_colormap.py::test_categorical_colormap_from_dict
ImageClass 2 ...t_layer_attributes.py::test_get_value_at_subpixel_offsets
tree_model 2 ...ainers/_tests/test_qt_tree.py::test_move_single_tree_item
labels_data_4d 2 ...labels/_tests/test_labels_key_bindings.py::test_max_label
result 2 ...ts/_tests/test_qt_play.py::test_animation_thread_variants
ext 2 napari/settings/_tests/test_settings.py::test_full_serialize
shortcut 2 .../utils/_tests/test_interactions.py::test_shortcut_invalid
qt_open 2 napari/_tests/test_cli.py::test_cli_passes_kwargs
true_colors 2 ...colormaps/_tests/test_color_to_array.py::test_oned_points
vec_2 2 ...ts/test_geometry.py::test_rotation_matrix_from_vectors_2d
ax_input 2 ...omponents/_tests/test_dims.py::test_assert_axis_in_bounds
view_dir 2 ...s/_tests/test_geometry.py::test_click_in_quadrilateral_3d
arg 2 ...sts/test_plugin_widgets.py::test_dock_widget_registration
use_selection 2 ...test_qt_viewer.py::test_label_colors_matching_widget_auto
affine_size 2 ...age.py::test_2d_image_with_channels_and_affine_broadcasts
quadrilateral 2 ...s/_tests/test_geometry.py::test_point_in_quadrilateral_2d
bevel 2 ...tests/test_triangulation.py::test_generate_2D_edge_meshes
dims 2 ...omponents/_tests/test_layers_base.py::test_world_to_layer
translate 2 ...s/test_vispy_image_layer.py::test_transforming_child_node
exp_level 2 ...scale.py::test_update_draw_variable_fov_fixed_canvas_size
spec 2 napari_builtins/_tests/test_io.py::test_single_file
vector 2 ...ts/test_image.py::test_projected_distance_from_mouse_drag
opacity 2 ...tests/test_vispy_surface_layer.py::test_VispySurfaceLayer
visible 2 napari/layers/labels/_tests/test_labels.py::test_view_dtype
event_define_check 2 ...els/_tests/test_labels.py::TestLabels.test_events_defined
exp_corner_pixels_data 2 ...scale.py::test_update_draw_variable_fov_fixed_canvas_size
popup 2 ..._qt_range_slider_popup.py::test_range_slider_popup_labels
line_position 2 ...tests/test_geometry.py::test_intersect_line_with_plane_3d
layer_type 2 napari/_tests/test_view_layers.py::test_view
image_file 2 napari/utils/_tests/test_io.py::test_imsave
save_image 2 ...ri_builtins/_tests/test_reader.py::test_reader_plugin_tif
colormap_like 2 ...ps/_tests/test_colormap.py::test_normalize_label_colormap
filename_call 2 napari/_qt/_qapp_model/_tests/test_file_menu.py::test_open
mock_show 2 ...t_image_base_layer_.py::test_clim_right_click_shows_popup
length 2 .../test_vispy_vectors_layer.py::test_generate_vector_meshes
edge_width 2 .../test_vispy_vectors_layer.py::test_generate_vector_meshes
plane_normal 2 ...tests/test_geometry.py::test_intersect_line_with_plane_3d
im_layer 2 ..._vispy/_tests/test_vispy_image_layer.py::test_base_create
pre_selection 2 .../test_points_mouse_bindings.py::test_drag_start_selection
path 2 ...tests/test_triangulation.py::test_generate_2D_edge_meshes
mocked_object 2 ..._model.py::test_evented_model_with_property_setter_events
preview_widget 2 ...st_qt_size_preview.py::test_qt_font_size_preview_defaults
click_position 2 ...s/_tests/test_geometry.py::test_click_in_quadrilateral_3d
on_point 2 .../test_points_mouse_bindings.py::test_drag_start_selection
end_position 2 ...ts/test_image.py::test_projected_distance_from_mouse_drag
star_widget 2 ...tests/test_qt_highlight_preview.py::test_qt_star_defaults
confirm_key 2 ...ests/test_shortcut_editor_widget.py::test_remove_shortcut
style 2 .../test_vispy_vectors_layer.py::test_generate_vector_meshes
mag 1 ...base_layer.py::test_clim_slider_step_size_and_precision
pattern 1 ...on2reader.py::test_filtering_readers_problematic_patterns
native 1 ...mponents/_tests/test_viewer_mouse_bindings.py::test_paint
limit 1 ..._tests/test_shapes_utils.py::test_generate_2D_edge_meshes
perf_config 1 napari/_qt/perf/_tests/test_perf.py::test_trace_on_start
plane_intercept 1 ...tests/test_geometry.py::test_line_with_axis_aligned_plane
mocked_method 1 ...i/_vispy/_tests/test_vispy_calls.py::test_ndisplay_change
expected_data_view 1 napari/layers/labels/_tests/test_labels.py::test_contour
field 1 ...ents/_tests/test_viewer_model.py::test_not_mutable_fields
background_num 1 ...ayers/labels/_tests/test_labels.py::test_background_label
nshape 1 ...omponents/_tests/test_layers_base.py::test_world_to_layer
a_unique_name 1 napari/_tests/test_viewer.py::test_add_layer_magic_name
test_data 1 .../layers/_tests/test_data_protocol.py::test_layer_protocol
image_shape 1 ...s/test_layer_attributes.py::test_layer_bounding_box_order
image_layer3d 1 ...t_magicgui.py::test_magicgui_add_data_inheritance_surface
BaseClass 1 ..._qt/_tests/test_qt_window.py::test_add_plugin_dock_widget
end 1 .../_tests/test_shapes_utils.py::test_perpendicular_distance
reason 1 .../utils/_tests/test_interactions.py::test_shortcut_invalid
area 1 napari_builtins/_tests/test_measure.py::test_measure_shapes
selection 1 .../test_colormap.py::test_label_colormap_map_with_selection
expected_handedness 1 napari/components/_tests/test_camera.py::test_handedness
start_mock 1 ...i/_tests/test_conftest_fixtures.py::test_disable_throttle
new_val 1 ...tests/test_features_table.py::test_features_tables_dtypes
ndim_layer 1 ...s/test_layer_utils.py::test_dims_displayed_world_to_layer
coords 1 ...yers/points/_tests/test_points.py::test_add_points_direct
warn_text 1 ...ormaps/_tests/test_color_to_array.py::test_warning_colors
perfmon_script 1 napari/_qt/perf/_tests/test_perf.py::test_trace_on_start
new_vector_style 1 ...sts/test_vispy_vectors_layer.py::test_vector_style_change
action_title 1 ..._tests/test_view_menu.py::test_toggle_axes_scale_bar_attr
suffix 1 ...ponents/_tests/test_viewer_labels_io.py::test_open_labels
multiscale 1 ..._qt/_tests/test_qt_viewer.py::test_mixed_2d_and_3d_layers
display_name 1 .../_tests/test_colormaps.py::test_colormap_error_suggestion
n_viewers 1 napari/_tests/test_viewer.py::test_close_all
platform_simulate_ctrl_c 1 napari/_qt/_tests/test_sigint_interupt.py::test_sigint
enum_setting_class 1 ...s/_tests/test_preferences_dialog.py::test_StrEnum_widgets
initial 1 ...p_model/_tests/test_view_menu.py::test_toggle_canvas_ndim
layer_data 1 ...st_add_layers.py::test_add_layers_with_plugins_and_kwargs
cls 1 napari/_qt/containers/_tests/test_factory.py::test_factory
data_shape 1 ...ayers/points/_tests/test_points.py::test_selecting_points
theme 1 napari/_qt/_tests/test_qt_viewer.py::test_canvas_color
param 1 ...ests/test_plugin_widgets.py::test_get_widget_viewer_param
orientation 1 napari/components/_tests/test_camera.py::test_handedness
run_path 1 napari/_tests/test_cli.py::test_cli_runscript
preserve_labels 1 napari/layers/labels/_tests/test_labels.py::test_undo_redo
expected_distances 1 ...tils/_tests/test_geometry.py::test_project_point_to_plane
expected_event_values 1 ..._model.py::test_evented_model_with_property_setter_events
curr_color 1 ..._tests/test_color_manager.py::test_current_color_coercion
text 1 ...qt/widgets/_tests/test_qt_plugin_sorter.py::test_rst2html
method_params 1 napari/_qt/_qapp_model/_tests/test_file_menu.py::test_close
line_start 1 ...tests/test_geometry.py::test_line_with_axis_aligned_plane
group_index 1 ...ls/events/_tests/test_evented_list.py::test_nested_events
disconnect_and_should_be_none 1 ...ests/test_event_emitter.py::test_weakref_event_emitter_cb
expected_position 1 ...test_geometry.py::test_find_nearest_triangle_intersection
target_indices 1 .../_tests/test_points.py::test_point_slice_request_response
Widget 1 ...tests/test_plugin_widgets.py::test_widget_types_supported
editor_class 1 ...tests/test_features_table.py::test_features_tables_dtypes
zarr_version 1 ...ayers/labels/_tests/test_labels.py::test_fill_tensorstore
numeric_features 1 ...encoding.py::test_format_with_mixed_feature_numeric_types
initial_vector_style 1 ...sts/test_vispy_vectors_layer.py::test_vector_style_change
index 1 ...ormaps/_tests/test_colormap_utils.py::test_label_colormap
rotate 1 ...s/test_vispy_image_layer.py::test_transforming_child_node
selected_label 1 napari/layers/labels/_tests/test_labels.py::test_undo_redo
triangle 1 napari/utils/_tests/test_geometry.py::test_inside_triangles
n_colors 1 ...sts/test_color_manager.py::test_init_color_manager_direct
module 1 .../utils/_tests/test_dtype.py::test_normalize_dtype_np_noop
exp_rotate 1 ...s/test_vispy_image_layer.py::test_transforming_child_node
size 1 ...olormap.py::test_cast_direct_labels_to_minimum_type_naive
translation 1 ...ils/_tests/test_text_manager.py::test_compute_text_coords
editable_after 1 ...est_qt_layer_controls.py::test_set_3d_display_with_points
brush_size 1 napari/layers/labels/_tests/test_labels.py::test_undo_redo
new_value 1 ...oints/_tests/test_points.py::test_new_point_size_editable
feature_name 1 ...st_set_current_properties_on_empty_layer_with_color_cycle
country_wth_hole 1 ...ation.py::test_normalize_vertices_and_edges_py_numba_same
expected_center 1 ...test_viewer_model.py::test_fit_to_view_center_calculation
action_dockwidget_name 1 ...tests/test_window_menu.py::test_toggle_dockwidget_actions
url 1 .../_qt/_qapp_model/_tests/test_help_menu.py::test_help_urls
image_layer 1 ...ests/test_magicgui.py::test_magicgui_add_data_inheritance
triangulation_backend 1 ..._shapes_models/_tests/test_shapes_models.py::test_polygon
nframes 1 ...ts/_tests/test_qt_play.py::test_animation_thread_variants
cat_cmap 1 ...est_color_manager.py::test_categorical_colormap_from_dict
rendered_val 1 ...tests/test_features_table.py::test_features_tables_dtypes
expected_barycentric_coordinates 1 ..._surface_utils.py::test_calculate_barycentric_coordinates
warn_message 1 ...maps/_tests/test_color_to_array.py::test_warns_but_parses
use_dask 1 napari_builtins/_tests/test_io.py::test_magic_imread
label_type 1 ...components/_tests/test_prune_kwargs.py::test_prune_kwargs
help_info 1 ...test_qt_plugin_sorter.py::test_qt_plugin_sorter_help_info
raise_func 1 ...st_qt_notifications.py::test_notification_manager_via_gui
mpl_name 1 ...s.py::test_ensure_colormap_with_recognized_mpl_color_name
contrast_limits_range 1 ..._set_contrast_limits_range_at_boundary_of_contrast_limits
expected_colors 1 ...yers/points/_tests/test_points.py::test_add_points_direct
show_text 1 .../widgets/_tests/test_qt_tooltip.py::test_qt_tooltip_label
attr 1 ...sts/test_shapes_mouse_bindings.py::test_all_modes_covered
exModel 1 napari/_qt/containers/_tests/test_factory.py::test_factory
modifier_key 1 ..._widget.py::test_keybinding_editor_modifier_key_detection
timestamps 1 ...st_tracks.py::test_track_layer_data_nonzero_starting_time
p 1 ...st_vispy_vectors_layer.py::test_generate_vector_meshes_2D
nearby_handle 1 ..._tests/test_mouse_bindings.py::test_highlight_box_handles
enum_setting_name 1 ...s/_tests/test_preferences_dialog.py::test_StrEnum_widgets
exp_translate 1 ...s/test_vispy_image_layer.py::test_transforming_child_node
expected_alt_text 1 napari/_tests/test_notebook_display.py::test_safe_alt_text
valid 1 ...cut_editor_widget.py::test_keybinding_with_only_modifiers
action_text 1 ...tests/test_window_menu.py::test_toggle_dockwidget_actions
mock_update_theme_no_event 1 napari/_qt/_tests/test_qt_window.py::test_update_theme
shape_data 1 napari_builtins/_tests/test_measure.py::test_measure_shapes
removal_trigger_key 1 ...ests/test_shortcut_editor_widget.py::test_remove_shortcut
alt_text_input 1 napari/_tests/test_notebook_display.py::test_safe_alt_text
layer_action 1 ...t_actions.py::test_layer_actions_ctx_menu_execute_command
perimeter 1 napari_builtins/_tests/test_measure.py::test_measure_shapes
filename 1 ...gs/_tests/test_screenshot_dialog.py::test_screenshot_save
use_ext 1 napari_builtins/_tests/test_writer.py::test_layer_save
stacks 1 napari_builtins/_tests/test_io.py::test_single_file
texture_shape 1 ...ispy/_tests/test_vispy_surface_layer.py::test_add_texture
plane_position 1 ...tests/test_geometry.py::test_intersect_line_with_plane_3d
fps 1 ...ts/_tests/test_qt_play.py::test_animation_thread_variants
corner_pixels_world 1 ...scale.py::test_update_draw_variable_fov_fixed_canvas_size
layer_list_dim 1 ...on_layer.py::test_copy_spatial_to_clipboard_different_dim
action_status_tooltip 1 ...tests/test_window_menu.py::test_toggle_dockwidget_actions
start 1 .../_tests/test_shapes_utils.py::test_perpendicular_distance
ndim_world 1 ...s/test_layer_utils.py::test_dims_displayed_world_to_layer
as_html 1 ...plugins/_tests/test_exceptions.py::test_format_exceptions
expected_text 1 ...qt/widgets/_tests/test_qt_plugin_sorter.py::test_rst2html
num_colors 1 ...sts/test_labels.py::test_color_shuffling_above_num_colors
layer_and_type 1 ...ests/test_magicgui.py::test_magicgui_add_data_inheritance
canvas_size_pixels 1 ...scale.py::test_update_draw_variable_canvas_size_fixed_fov
n_edit_dimensions 1 napari/layers/labels/_tests/test_labels.py::test_undo_redo
layer_shape 1 .../test_viewer_mouse_bindings.py::test_double_click_to_zoom
menu_id 1 ...l/_tests/test_qapp_model_menus.py::test_build_qmodel_menu
surface_layer 1 ...t_magicgui.py::test_magicgui_add_data_inheritance_surface
action_manager_trigger 1 ...rols.py::test_create_layer_controls_transform_mode_button
angle_degrees 1 ...ests/test_image.py::test_rotate_with_reflections_in_scale
sub_attr 1 ..._tests/test_view_menu.py::test_toggle_axes_scale_bar_attr
create_complex_shape 1 napari/layers/shapes/_tests/test_shapes_utils.py::test_rdp
color_by 1 ...acks_layer.py::test_color_by_same_after_properties_change
type_ 1 ...i/layers/_tests/test_layer_actions.py::test_convert_layer
background 1 ...test_colormap.py::test_label_colormap_map_with_background
expected_projected_point 1 ...tils/_tests/test_geometry.py::test_project_point_to_plane
is_qt_tag_present 1 ...ts/test_qt_event_filters.py::test_qt_tooltip_event_filter
angles 1 ...vispy/_tests/test_utils.py::test_quaternion2euler_degrees
viewer_attr 1 ..._tests/test_view_menu.py::test_toggle_axes_scale_bar_attr
render_mode 1 napari/layers/image/_tests/test_image.py::test_value_3d
cgitb 1 ...plugins/_tests/test_exceptions.py::test_format_exceptions
dims_indices 1 .../_tests/test_points.py::test_point_slice_request_response
widget_callable 1 ...ests/test_plugin_widgets.py::test_get_widget_viewer_param
add_layer_with_data 1 ...yer_controls.py::test_set_3d_display_and_layer_visibility
warn_func 1 ...st_qt_notifications.py::test_notification_manager_via_gui
severity 1 ...tests/test_qt_notifications.py::test_notification_display
nworld 1 ...omponents/_tests/test_layers_base.py::test_world_to_layer
hook_name 1 ...test_qt_plugin_sorter.py::test_qt_plugin_sorter_help_info
anchor_type 1 ...rs/utils/_tests/test_text_utils.py::test_get_text_anchors
pytester_pretty 1 napari/_tests/test_pytest_plugin.py::test_make_napari_viewer
pyramid_layer 1 ...ispy_image_layer.py::test_transforming_child_node_pyramid
layer_datum 1 ...s/_tests/test_add_layers.py::test_add_layers_with_plugins
prepend 1 napari/layers/shapes/_tests/test_shapes.py::test_nd_text
expected_indices 1 ...yers/points/_tests/test_points.py::test_add_points_direct
keymap_mock 1 napari/utils/_tests/test_key_bindings.py::test_bind_user_key
menu_str 1 ...app_model/_tests/test_file_menu.py::test_open_with_plugin
v 1 napari/_qt/_tests/test_threading_progress.py::test_yield
expected_dim 1 ...mponents/_tests/test_viewer_mouse_bindings.py::test_paint
val 1 ...tests/test_features_table.py::test_features_tables_dtypes
true_color 1 ...maps/_tests/test_color_to_array.py::test_warns_but_parses
direct 1 napari/_qt/_tests/test_qt_viewer.py::test_thumbnail_labels
upper_triangular 1 ...sts/test_transform_utils.py::test_decompose_linear_matrix
shape_type_vertices 1 ...sts/test_shapes_mouse_bindings.py::test_add_invalid_shape
zarr_driver 1 ...ayers/labels/_tests/test_labels.py::test_fill_tensorstore
exView 1 napari/_qt/containers/_tests/test_factory.py::test_factory
colormap 1 napari/layers/labels/_tests/test_labels.py::test_draw

Detailed Fixture Usage

Complete list of all fixtures and their usage:

Fixture Usage Count Documented First Few Usages
make_napari_viewer 260 test_multi_viewers_dont_clash
test_imshow_with_viewer
test_4D_5D_images
... and 257 more
qtbot 251 test_multi_viewers_dont_clash
test_view
test_view_multichannel
... and 248 more
monkeypatch 76 test_kwargs_passed
test_lack_disable_throttle
test_running_status_thread
... and 73 more
tmp_path 60 test_add_layer_magic_name
test_cli_runscript
test_export_figure
... and 57 more
ndim 33 test_view
test_add_layer
test_all_layer_actions_are_accessible_via_shortcut
... and 30 more
expected 33 test_fix_data_dtype_big_values
test_toggle_canvas_ndim
test_world_to_layer
... and 30 more
data 31 test_view
test_add_layer
test_all_layer_actions_are_accessible_via_shortcut
... and 28 more
tmp_plugin 29 test_cli_shows_plugins
test_widget_types_supported
test_all_readers_in_dropdown
... and 26 more
features 29 test_scalar_constant_encoding_apply
test_scalar_manual_encoding_apply_with_shorter
test_scalar_manual_encoding_apply_with_equal_length
... and 26 more
attribute 26 test_evented_model_with_property_setter_events
test_adding_properties
test_switch_color_mode
... and 23 more
builtins 25 test_examples
test_filtering_readers
test_filtering_readers_problematic_patterns
... and 22 more
create_known_shapes_layer 25 test_not_adding_or_selecting_shape
test_add_simple_shape
test_line_fixed_angles
... and 22 more
dtype 24 test_image_dytpes
test_label_colors_matching_widget_auto
test_label_colors_matching_widget_direct
... and 21 more
qt_viewer 23 test_active_layer_highlight_visibility
test_export_figure
test_export_figure_3d
... and 20 more
layer_slicer 20 test_submit_with_one_async_layer_no_block
test_submit_with_multiple_async_layer_no_block
test_submit_emits_ready_event_when_done
... and 17 more
layer 19 test_docstring
test_signature
test_orient_plane_normal_around_cursor
... and 16 more
tmpdir 18 test_screenshot_dialog
test_reader_defaults
test_reader_dir_with_extension
... and 15 more
properties 18 test_tracks_controls_color_by
test_color_by_same_after_properties_change
test_color_by_missing_after_properties_change
... and 15 more
napari_plugin_manager 15 test_view
test_view_multichannel
test_imshow
... and 12 more
trans 15 test_get_language_packs
test_locale_singular
test_locale_singular_with_format
... and 12 more
create_known_points_layer_2d 15 test_not_adding_or_selecting_point
test_add_point
test_drag_in_add_mode
... and 12 more
mode 14 test_selection_collision
test_animation_thread_variants
test_projections
... and 11 more
mock_pm 14 test_sample_menu_sorted
test_plugins_menu_sorted
test_read
... and 11 more
Transform 14 test_transform_chain
test_transform_chain_simplified
test_transform_chain_inverse
... and 11 more
MouseEvent 14 test_labels_painting_with_mouse
test_labels_drawing_with_polygons
test_paint
... and 11 more
qapp 13 test_disable_qthread
test_screenshot
test_thread_proxy_guard
... and 10 more
dims_displayed 12 test_highlight_box_handles
test_layer_bounding_box_order
test_interaction_box_translation
... and 9 more
Layer 12 test_add_all_layers
test_add_remove_layer_external_callbacks
test_add_remove_layer_no_callbacks
... and 9 more
color 12 test_succesfull_create_qcolorswatchedit
test_succesfull_create_qcolorswatch
test_theme
... and 9 more
pref 12 test_prefdialog_populated
test_dask_widget
test_font_size_widget
... and 9 more
extension2reader_widget 11 test_extension2reader_defaults
test_extension2reader_with_settings
test_extension2reader_removal
... and 8 more
font_size_preview_widget 11 test_qt_size_slider_preview_widget_defaults
test_qt_size_slider_preview_widget_description
test_qt_size_slider_preview_widget_unit
... and 8 more
make_labels_controls 11 test_changing_layer_color_mode_updates_combo_box
test_changing_layer_show_selected_label_updates_check_box
test_rendering_combobox
... and 8 more
tree 11 test_tree_str
test_node_indexing
test_relative_node_indexing
... and 8 more
test_settings 11 test_settings_file
test_settings_autosave
test_settings_file_not_created
... and 8 more
highlight_preview_widget 10 test_qt_highlight_preview_widget_defaults
test_qt_highlight_preview_widget_description
test_qt_highlight_preview_widget_unit
... and 7 more
kwargs 10 test_multichannel
test_add_layers_with_plugins_and_kwargs
test_deepcopy
... and 7 more
action_id 9 test_open
test_save_layers
test_screenshot
... and 6 more
layer_list 9 test_copy_scale_to_clipboard
test_copy_units_to_clipboard
test_copy_translate_to_clipboard
... and 6 more
ten_four_corner 9 test_add_shapes
test_rectangles_with_shape_type
test_rectangles_with_shape_type_per_element
... and 6 more
AffineType 9 test_empty_units
test_set_units_constructor
test_set_units_constructor_error
... and 6 more
name 8 test_mgui_forward_refs
test_colormap
test_colormap_error_suggestion
... and 5 more
capsys 8 test_cli_works
test_cli_shows_plugins
test_publicproxy_provide_viewer
... and 5 more
shortcut_editor_widget 8 test_shortcut_editor_defaults
test_potentially_conflicting_actions
test_mark_conflicts
... and 5 more
layer_type_with_data 8 test_create_layer_controls
test_create_layer_controls_spin
test_create_layer_controls_qslider
... and 5 more
layer_class 7 test_add_layer
test_all_layer_actions_are_accessible_via_shortcut
test_add_layer_magic_name
... and 4 more
rng 7 test_async_slice_image_on_current_step_change
test_async_slice_image_on_order_change
test_async_slice_image_on_ndisplay_change
... and 4 more
tif_reader 7 test_all_readers_in_dropdown
test_filtering_readers
test_filtering_readers_problematic_patterns
... and 4 more
mock_app_model 7 test_toggle_ndisplay
test_command_palette_app_model_sync
test_sample_menu_sorted
... and 4 more
reader_dialog 7 test_reader_dialog_buttons
test_reader_defaults
test_reader_with_error_message
... and 4 more
layer_data_and_types 7 test_layers_save
test_layers_save_none_selected
test_layers_save_selected
... and 4 more
create_known_points_layer_3d 7 test_add_point_3d
test_select_point_3d
test_unselect_by_click_point_3d
... and 4 more
view_direction 7 test_value_3d
test_value_3d
test_projected_distance_from_mouse_drag
... and 4 more
feature_table 7 test_feature_table_resize_smaller
test_feature_table_resize_larger
test_feature_table_append
... and 4 more
position 6 test_highlight_box_handles
test_value_3d
test_value_3d
... and 3 more
stack 6 test_open_files_dialog
test_open
test_open_with_plugin
... and 3 more
viewer_model 6 test_export_figure
test_export_figure_3d
test_export_rois
... and 3 more
layer_list_dim2 6 test_paste_scale_higher_dim
test_paste_units_higher_dim
test_paste_translate_higher_dim
... and 3 more
create_layer_controls 6 test_create_layer_controls
test_create_layer_controls_spin
test_create_layer_controls_qslider
... and 3 more
shape 6 test_multichannel
test_downsample_value
test_guess_rgb_property
... and 3 more
order 6 test_reorder_after_dim_reduction
test_3d_slice_of_2d_image_with_order
test_2d_slice_of_3d_image_with_order
... and 3 more
test_list 6 test_list_interface_parity
test_hash
test_list_interface_exceptions
... and 3 more
scale 6 test_node_origin_is_consistent_with_multiscale
test_value_3d
test_image_scale
... and 3 more
expected_coords 6 test_bbox_center
test_bbox_upper_left
test_bbox_upper_right
... and 3 more
func 5 test_viewer_actions
test_hook_specification_naming
test_docstring_on_hook_specification
... and 2 more
LayerType 5 test_get_ndim_from_data
test_magicgui_add_data
test_magicgui_add_future_data
... and 2 more
request 5 test_dock_widget_registration
test_list
test_dict
... and 2 more
recwarn 5 test_dock_widget_registration
test_keybinding_with_modifiers
test_keybinding_with_only_modifiers
... and 2 more
ref_view 5 test_play_raises_index_errors
test_play_raises_value_errors
test_playing_hidden_slider_does_nothing
... and 2 more
npy_reader 5 test_filtering_readers
test_filtering_readers_problematic_patterns
test_filtering_readers_complex_pattern
... and 2 more
qt_viewer_buttons 5 test_roll_dims_button_popup
test_grid_view_button_popup
test_ndisplay_button_popup
... and 2 more
triangle_widget 5 test_qt_triangle_defaults
test_qt_triangle_value
test_qt_triangle_minimum
... and 2 more
expectation 5 test_nested_move_multiple
test_move_multiple
test_prune_kwargs
... and 2 more
null_data 5 test_tracks_controls_color_by
test_color_by_same_after_properties_change
test_color_by_missing_after_properties_change
... and 2 more
ndisplay 5 test_fit_to_view_center_calculation
test_ndisplay_change
test_node_origin_is_consistent_with_multiscale
... and 2 more
input_data 5 test_sequence_of_iterables
test_ensure_iterable
test_ensure_list_of_layer_data_tuple
... and 2 more
point 5 test_project_point_to_plane
test_clamp_point_to_bounding_box
test_point_in_quadrilateral_2d
... and 2 more
meth 5 test_list_interface_parity
test_nested_events
test_dict_interface_parity
... and 2 more
value 5 test_evented_model_with_property_setter_events
test_events_callback
test_link_image_layers_all_attributes
... and 2 more
dimensionality 5 test_affine_matrix
test_affine_matrix_compose
test_numpy_array_protocol
... and 2 more
cube_layer 5 test_VispySurfaceLayer
test_shading
test_add_texture
... and 2 more
delayed_dask_stack 5 test_dask_global_optimized_slicing
test_dask_unoptimized_slicing
test_dask_local_unoptimized_slicing
... and 2 more
world 5 test_value_3d
test_value_3d
test_value_3d
... and 2 more
view_data 5 test_bbox_center
test_bbox_upper_left
test_bbox_upper_right
... and 2 more
poly_hole 5 test_normalize_vertices_and_edges
test_normalize_vertices_and_edges
test_reconstruct_and_triangulate_edge
... and 2 more
test_migrator 5 test_no_migrations_available
test_backwards_migrator
test_migration_works
... and 2 more
mock_run 4 test_cli_parses_unknowns
test_cli_passes_kwargs
test_cli_passes_kwargs_stack
... and 1 more
single_threaded_executor 4 test_thread_proxy_guard
test_proxy_fixture_thread_error
test_wait_until_idle
... and 1 more
count_show 4 test_notification_manager_via_gui
test_show_notification_from_thread
test_notification_display
... and 1 more
sources 4 test_nested_move_multiple
test_move_multiple
test_move_multiple
... and 1 more
dest 4 test_nested_move_multiple
test_move_multiple
test_move_multiple
... and 1 more
pos 4 TestQtPopup.test_move_to
TestQtPopup.test_move_to_cords
test_move_to
... and 1 more
dialog_return 4 test_open
test_open_with_plugin
test_save_layers
... and 1 more
editable_layer 4 test_make_visible_when_editable_enables_edit_buttons
test_make_not_visible_when_editable_disables_edit_buttons
test_make_editable_when_visible_enables_edit_buttons
... and 1 more
action_manager 4 test_unbind_non_existing_action
test_bind_multiple_action
test_bind_unbind_existing_action
... and 1 more
dtype_str 4 test_normalize_dtype_torch
test_normalize_dtype_tensorstore
test_normalize_dtype_np_noop
... and 1 more
bounding_box 4 test_clamp_point_to_bounding_box
test_face_coordinate_from_bounding_box
test_find_front_back_face
... and 1 more
colors 4 test_ensure_colormap_with_multi_colors
test_oned_points
test_twod_points
... and 1 more
regular_list 4 test_list
test_list_interface_parity
test_copy
... and 1 more
list_type 4 test_type_enforcement
test_type_enforcement_with_slices
test_multitype_enforcement
... and 1 more
expected_value 4 test_projected_distance_from_mouse_drag
test_drag_data_to_projected_distance
test_get_value_3d
... and 1 more
two_and_four_corners 4 test_rectangles
test_rectangles_add_method
test_ellipses
... and 1 more
ten_two_corners 4 test_ellipses_two_corner_with_shape_type
test_ellipses_two_corner_with_shape_type_per_shape
test_ten_lines_with_shape_type
... and 1 more
write_spec 4 test_single_file
test_magic_imread
test_irregular_images
... and 1 more
caplog 3 test_update_lazy_console
test_theme_registration
test_settings_load_invalid_type
mock_add_theme 3 test_provide_theme_hook_registered_correctly
test_plugin_provide_theme_hook_set_settings_correctly
test_update_theme
mock_remove_theme 3 test_provide_theme_hook_registered_correctly
test_plugin_provide_theme_hook_set_settings_correctly
test_update_theme
npe2pm 3 test_shimmed_dialog_no_plugins
test_shimmed_dialog_already_warned
test_shimmed_dialog_show
tooltip 3 test_qt_tooltip_event_filter
test_succesfull_create_qcolorswatchedit
test_succesfull_create_qcolorswatch
key 3 test_keybinding_with_modifiers
test_link_image_layers_all_attributes
test_link_different_type_layers_all_attributes
modifier 3 test_keybinding_with_modifiers
test_drag_start_selection
test_drag_start_selection
key_symbols 3 test_keybinding_with_modifiers
test_keybinding_with_only_modifiers
test_keybinding_editor_modifier_key_detection
modifiers 3 test_keybinding_with_only_modifiers
test_keybinding_editor_modifier_key_detection
test_paint
dialog_method 3 test_open
test_open_with_plugin
test_save_layers
patch_method 3 test_screenshot
test_restart
test_close
line_direction 3 test_intersect_line_with_plane_3d
test_line_with_axis_aligned_plane
test_intersect_line_with_axis_aligned_bounding_box_3d
ray_start 3 test_find_nearest_triangle_intersection
test_get_value_3d
test_get_value_3d_nd
ray_direction 3 test_find_nearest_triangle_intersection
test_get_value_3d
test_get_value_3d_nd
expected_index 3 test_find_nearest_triangle_intersection
test_get_value_3d
test_get_value_3d_nd
num 3 test_minimum_dtype_for_labels
test_cast_labels_to_minimum_type_auto
test_test_cast_direct_labels_to_minimum_type_no_jit
direct_label_colormap 3 test_direct_label_colormap_simple
test_direct_label_colormap_selection
test_cast_direct_labels_to_minimum_type
regular_dict 3 test_dict
test_dict_interface_parity
test_copy
regular_set 3 test_set
test_set_interface_parity
test_set_new_objects
test_set 3 test_set_interface_parity
test_set_clear
test_set_new_objects
array_type 3 test_labels_painting
test_labels_fill_slice
test_labels_painting_with_mouse
color_cycle 3 test_color_cycle
test_color_cycle
test_color_cycle
shape_type 3 test_add_simple_shape
test_add_complex_shape
test_measure_shapes
closed 3 test_generate_2D_edge_meshes
test_remove_path_duplicates
test_generate_2D_edge_meshes
layer_type 2 test_view
test_duplicate_layers
qt_open 2 test_cli_passes_kwargs
test_cli_passes_kwargs_stack
fname 2 test_examples
test_dev_examples
qt_viewer_with_controls 2 test_label_colors_matching_widget_auto
test_label_colors_matching_widget_direct
use_selection 2 test_label_colors_matching_widget_auto
test_label_colors_matching_widget_direct
arg 2 test_dock_widget_registration
test_function_widget_registration
make_napari_viewer_proxy 2 test_proxy_fixture_warning
test_proxy_fixture_thread_error
confirm_key 2 test_remove_shortcut
test_preferences_dialog_not_dismissed_by_keybind_confirm
result 2 test_animation_thread_variants
test_value_3d
preview_widget 2 test_qt_font_size_preview_defaults
test_qt_font_size_preview_text
star_widget 2 test_qt_star_defaults
test_qt_star_value
popup 2 test_range_slider_popup_labels
test_range_slider_changes_labels
tree_model 2 test_move_single_tree_item
test_flags
filename_call 2 test_open
test_open_with_plugin
perfmon_activation 2 test_debug_menu_exists
test_start_stop_trace_actions
mock_show 2 test_clim_right_click_shows_popup
test_range_popup_clim_buttons
dims 2 test_world_to_layer
test_generate_vector_meshes
ax_input 2 test_assert_axis_in_bounds
test_assert_axis_out_of_bounds
shortcut 2 test_shortcut_invalid
test_partial_shortcuts
image_file 2 test_imsave
test_imsave_float
vec_1 2 test_rotation_matrix_from_vectors_2d
test_rotation_matrix_from_vectors_3d
vec_2 2 test_rotation_matrix_from_vectors_2d
test_rotation_matrix_from_vectors_3d
line_position 2 test_intersect_line_with_plane_3d
test_intersect_line_with_axis_aligned_bounding_box_3d
plane_normal 2 test_intersect_line_with_plane_3d
test_line_with_axis_aligned_plane
face_normal 2 test_face_coordinate_from_bounding_box
test_intersect_line_with_axis_aligned_bounding_box_3d
quadrilateral 2 test_point_in_quadrilateral_2d
test_click_in_quadrilateral_3d
click_position 2 test_click_in_quadrilateral_3d
test_find_front_back_face
view_dir 2 test_click_in_quadrilateral_3d
test_find_front_back_face
colormap_like 2 test_normalize_label_colormap
test_colormap_simple_data_types
true_colors 2 test_oned_points
test_twod_points
params 2 test_categorical_colormap_from_dict
test_categorical_colormap_serialization
dict_type 2 test_type_enforcement
test_multitype_enforcement
test_dict 2 test_dict_interface_parity
test_copy
mocked_object 2 test_evented_model_with_property_setter_events
test_evented_model_with_property_without_setter
edge_width 2 test_generate_vector_meshes
test_generate_vector_meshes_2D
length 2 test_generate_vector_meshes
test_generate_vector_meshes_2D
style 2 test_generate_vector_meshes
test_generate_vector_meshes_2D
opacity 2 test_VispySurfaceLayer
test_VispyPointsLayer
im_layer 2 test_base_create
test_transforming_child_node
translate 2 test_transforming_child_node
test_image_translate
ImageClass 2 test_get_value_at_subpixel_offsets
test_get_value_3d_view_of_2d_image
pre_selection 2 test_drag_start_selection
test_drag_start_selection
on_point 2 test_drag_start_selection
test_drag_start_selection
border_width 2 test_border_width_types
test_border_width_types_negative
affine_size 2 test_2d_image_with_channels_and_affine_broadcasts
test_2d_image_with_channels_and_affine_assignment_broadcasts
start_position 2 test_projected_distance_from_mouse_drag
test_drag_data_to_projected_distance
end_position 2 test_projected_distance_from_mouse_drag
test_drag_data_to_projected_distance
vector 2 test_projected_distance_from_mouse_drag
test_drag_data_to_projected_distance
exp_level 2 test_update_draw_variable_fov_fixed_canvas_size
test_update_draw_variable_canvas_size_fixed_fov
exp_corner_pixels_data 2 test_update_draw_variable_fov_fixed_canvas_size
test_update_draw_variable_canvas_size_fixed_fov
c_props 2 test_color_properties_coercion
test_invalid_color_properties
single_four_corner 2 test_rectangle_with_shape_type
test_single_ellipses_with_shape_type
single_two_corners 2 test_single_ellipses_two_corner_with_shape_type
test_single_lines_with_shape_type
two_corners 2 test_lines
test_lines_add_method
polygons 2 test_adding_shapes
test_adding_shapes_per_shape
path 2 test_generate_2D_edge_meshes
test_generate_2D_edge_meshes
bevel 2 test_generate_2D_edge_meshes
test_generate_2D_edge_meshes
self_intersecting_polygon 2 test_is_convex_self_intersection
test_is_convex_self_intersection
regular_polygon 2 test_is_convex_regular_polygon
test_is_convex_regular_polygon
non_convex_poly 2 test_is_convex_non_convex
test_is_convex_non_convex
line 2 test_line_non_convex
test_line_non_convex
line_two_point 2 test_line_two_point_non_convex
test_line_two_point_non_convex
labels_data_4d 2 test_max_label
test_swap_background_label
event_define_check 2 TestLabels.test_events_defined
test_events_defined
obj 2 TestLabels.test_events_defined
test_events_defined
visible 2 test_view_dtype
test_view_dtype_int16
ext 2 test_full_serialize
test_reader_plugin_tif
save_image 2 test_reader_plugin_tif
test_animated_gif_reader
some_layer 2 test_layer_save
test_no_write_layer_bad_extension
spec 2 test_single_file
test_magic_imread
nearby_handle 1 test_highlight_box_handles
start_mock 1 test_disable_throttle
alt_text_input 1 test_safe_alt_text
expected_alt_text 1 test_safe_alt_text
a_unique_name 1 test_add_layer_magic_name
n_viewers 1 test_close_all
pytester_pretty 1 test_make_napari_viewer
layer_and_type 1 test_magicgui_add_data_inheritance
image_layer 1 test_magicgui_add_data_inheritance
surface_layer 1 test_magicgui_add_data_inheritance_surface
image_layer3d 1 test_magicgui_add_data_inheritance_surface
run_path 1 test_cli_runscript
theme 1 test_canvas_color
multiscale 1 test_mixed_2d_and_3d_layers
direct 1 test_thumbnail_labels
mock_update_theme_no_event 1 test_update_theme
BaseClass 1 test_add_plugin_dock_widget
raise_func 1 test_notification_manager_via_gui
warn_func 1 test_notification_manager_via_gui
severity 1 test_notification_display
v 1 test_yield
widget_callable 1 test_get_widget_viewer_param
param 1 test_get_widget_viewer_param
Widget 1 test_widget_types_supported
is_qt_tag_present 1 test_qt_tooltip_event_filter
platform_simulate_ctrl_c 1 test_sigint
show_text 1 test_qt_tooltip_label
valid 1 test_keybinding_with_only_modifiers
removal_trigger_key 1 test_remove_shortcut
modifier_key 1 test_keybinding_editor_modifier_key_detection
nframes 1 test_animation_thread_variants
fps 1 test_animation_thread_variants
pattern 1 test_filtering_readers_problematic_patterns
text 1 test_rst2html
expected_text 1 test_rst2html
hook_name 1 test_qt_plugin_sorter_help_info
help_info 1 test_qt_plugin_sorter_help_info
perf_config 1 test_trace_on_start
perfmon_script 1 test_trace_on_start
cls 1 test_factory
exView 1 test_factory
exModel 1 test_factory
enum_setting_name 1 test_StrEnum_widgets
enum_setting_class 1 test_StrEnum_widgets
filename 1 test_screenshot_save
menu_id 1 test_build_qmodel_menu
menu_str 1 test_open_with_plugin
method_params 1 test_close
action_text 1 test_toggle_dockwidget_actions
action_dockwidget_name 1 test_toggle_dockwidget_actions
action_status_tooltip 1 test_toggle_dockwidget_actions
layer_list_dim 1 test_copy_spatial_to_clipboard_different_dim
layer_action 1 test_layer_actions_ctx_menu_execute_command
url 1 test_help_urls
action_title 1 test_toggle_axes_scale_bar_attr
viewer_attr 1 test_toggle_axes_scale_bar_attr
sub_attr 1 test_toggle_axes_scale_bar_attr
initial 1 test_toggle_canvas_ndim
mag 1 test_clim_slider_step_size_and_precision
color_by 1 test_color_by_same_after_properties_change
action_manager_trigger 1 test_create_layer_controls_transform_mode_button
editable_after 1 test_set_3d_display_with_points
add_layer_with_data 1 test_set_3d_display_and_layer_visibility
layers 1 test_layers_save_svg
napari_svg_name 1 test_layers_save_svg
orientation 1 test_handedness
expected_handedness 1 test_handedness
suffix 1 test_open_labels
native 1 test_paint
expected_dim 1 test_paint
layer_shape 1 test_double_click_to_zoom
nworld 1 test_world_to_layer
nshape 1 test_world_to_layer
field 1 test_not_mutable_fields
expected_center 1 test_fit_to_view_center_calculation
layer_datum 1 test_add_layers_with_plugins
layer_data 1 test_add_layers_with_plugins_and_kwargs
label_type 1 test_prune_kwargs
reason 1 test_shortcut_invalid
module 1 test_normalize_dtype_np_noop
keymap_mock 1 test_bind_user_key
expected_projected_point 1 test_project_point_to_plane
expected_distances 1 test_project_point_to_plane
plane_position 1 test_intersect_line_with_plane_3d
plane_intercept 1 test_line_with_axis_aligned_plane
line_start 1 test_line_with_axis_aligned_plane
triangle 1 test_inside_triangles
expected_position 1 test_find_nearest_triangle_intersection
display_name 1 test_colormap_error_suggestion
mpl_name 1 test_ensure_colormap_with_recognized_mpl_color_name
selection 1 test_label_colormap_map_with_selection
background 1 test_label_colormap_map_with_background
size 1 test_cast_direct_labels_to_minimum_type_naive
true_color 1 test_warns_but_parses
warn_message 1 test_warns_but_parses
warn_text 1 test_warning_colors
index 1 test_label_colormap
group_index 1 test_nested_events
expected_event_values 1 test_evented_model_with_property_setter_events
disconnect_and_should_be_none 1 test_weakref_event_emitter_cb
upper_triangular 1 test_decompose_linear_matrix
mocked_method 1 test_ndisplay_change
angles 1 test_quaternion2euler_degrees
p 1 test_generate_vector_meshes_2D
initial_vector_style 1 test_vector_style_change
new_vector_style 1 test_vector_style_change
texture_shape 1 test_add_texture
exp_translate 1 test_transforming_child_node
rotate 1 test_transforming_child_node
exp_rotate 1 test_transforming_child_node
pyramid_layer 1 test_transforming_child_node_pyramid
cgitb 1 test_format_exceptions
as_html 1 test_format_exceptions
image_shape 1 test_layer_bounding_box_order
type_ 1 test_convert_layer
test_data 1 test_layer_protocol
feature_name 1 test_set_current_properties_on_empty_layer_with_color_cycle
data_shape 1 test_selecting_points
coords 1 test_add_points_direct
expected_indices 1 test_add_points_direct
expected_colors 1 test_add_points_direct
new_value 1 test_new_point_size_editable
dims_indices 1 test_point_slice_request_response
target_indices 1 test_point_slice_request_response
contrast_limits_range 1 test_set_contrast_limits_range_at_boundary_of_contrast_limits
render_mode 1 test_value_3d
angle_degrees 1 test_rotate_with_reflections_in_scale
corner_pixels_world 1 test_update_draw_variable_fov_fixed_canvas_size
canvas_size_pixels 1 test_update_draw_variable_canvas_size_fixed_fov
ndim_world 1 test_dims_displayed_world_to_layer
ndim_layer 1 test_dims_displayed_world_to_layer
numeric_features 1 test_format_with_mixed_feature_numeric_types
cat_cmap 1 test_categorical_colormap_from_dict
curr_color 1 test_current_color_coercion
n_colors 1 test_init_color_manager_direct
translation 1 test_compute_text_coords
anchor_type 1 test_get_text_anchors
shape_type_vertices 1 test_add_invalid_shape
attr 1 test_all_modes_covered
prepend 1 test_nd_text
twenty_four_corner 1 test_changing_shapes
country_wth_hole 1 test_normalize_vertices_and_edges_py_numba_same
limit 1 test_generate_2D_edge_meshes
create_complex_shape 1 test_rdp
start 1 test_perpendicular_distance
end 1 test_perpendicular_distance
triangulation_backend 1 test_polygon
expected_barycentric_coordinates 1 test_calculate_barycentric_coordinates
timestamps 1 test_track_layer_data_nonzero_starting_time
expected_data_view 1 test_contour
background_num 1 test_background_label
brush_size 1 test_undo_redo
selected_label 1 test_undo_redo
preserve_labels 1 test_undo_redo
n_edit_dimensions 1 test_undo_redo
zarr_version 1 test_fill_tensorstore
zarr_driver 1 test_fill_tensorstore
direct_colormap 1 test_invalidate_cache_when_change_color_mode
random_colormap 1 test_invalidate_cache_when_change_color_mode
num_colors 1 test_color_shuffling_above_num_colors
colormap 1 test_draw
shape_data 1 test_measure_shapes
perimeter 1 test_measure_shapes
area 1 test_measure_shapes
use_ext 1 test_layer_save
layers_list 1 test_get_writer_succeeds
stacks 1 test_single_file
use_dask 1 test_magic_imread
val 1 test_features_tables_dtypes
rendered_val 1 test_features_tables_dtypes
editor_class 1 test_features_tables_dtypes
new_val 1 test_features_tables_dtypes

Pytest Fixtures in napari

This document lists all pytest fixtures available in the napari codebase.

Table of Contents

Layer Fixtures

Fixture Name Location Scope/Info Description
layer src/napari/conftest.py:103 params=6 Parameterized fixture that supplies a layer for testing.
layer_data_and_types src/napari/conftest.py:72 - Fixture that provides some layers and filenames
layers src/napari/conftest.py:156 - Fixture that supplies a layers list for testing.
layers_list src/napari_builtins/_tests/conftest.py:57 - Layers List
some_layer src/napari_builtins/_tests/conftest.py:52 - Some Layer

Viewer Fixtures

Fixture Name Location Scope/Info Description
make_napari_viewer src/napari/utils/_testsupport.py:194 - Make Napari Viewer
make_napari_viewer_proxy src/napari/utils/_testsupport.py:403 - Fixture that returns a function for creating a napari viewer wrapped in proxy.
qt_viewer src/napari/conftest.py:411 - We created qt_viewer_ fixture to allow modifying qt_viewer
qt_viewer src/napari/_tests/test_with_screenshot.py:14 - Qt Viewer
qt_viewer src/napari/_qt/_tests/test_qt_viewer.py:1018 - Qt Viewer
qt_viewer_ src/napari/conftest.py:308 - Qt Viewer
qt_viewer_with_controls src/napari/_qt/_tests/test_qt_viewer.py:903 - Qt Viewer With Controls
viewer_model src/napari/conftest.py:301 - Viewer Model

Plugin Fixtures

Fixture Name Location Scope/Info Description
builtins src/napari/conftest.py:285 - Builtins
mock_npe2_pm src/napari_builtins/_tests/conftest.py:12 autouse Mock plugin manager with no registered plugins.
napari_plugin_manager src/napari/utils/_testsupport.py:85 - A napari plugin manager that blocks discovery by default.
napari_svg_name src/napari/conftest.py:265 - the plugin name changes with npe2 to napari-svg from svg.
npe2pm_ src/napari/conftest.py:276 autouse Autouse npe2 & npe1 mock plugin managers with no registered plugins.
tmp_plugin src/napari/conftest.py:291 - Tmp Plugin
use_builtins src/napari_builtins/_tests/conftest.py:21 autouse Use Builtins

Qt Testing Fixtures

Fixture Name Location Scope/Info Description
_dangling_qanimations src/napari/conftest.py:844 - Internal: dangling qanimations
_dangling_qthread_pool src/napari/conftest.py:665 - Internal: dangling qthread pool
_dangling_qthreads src/napari/conftest.py:571 - Internal: dangling qthreads
_dangling_qtimers src/napari/conftest.py:721 - Internal: dangling qtimers
_disable_throttling src/napari/conftest.py:827 - Disable qthrottler from superqt.

Settings & Environment Fixtures

Fixture Name Location Scope/Info Description
_clean_themes src/napari/utils/_testsupport.py:119 autouse Internal: clean themes
_clear_cached_action_injection src/napari/conftest.py:420 autouse Automatically clear cached property Action.injected.
_disable_notification_dismiss_timer src/napari/conftest.py:510 autouse This fixture disables starting timer for closing notification
_fix_magic_name src/napari/conftest.py:950 autouse, scope=session Fix napari.utils.naming.magic_name to handle test as as internal napari module.
_fresh_settings src/napari/conftest.py:199 autouse This fixture ensures that default settings are used for every test.
test_settings src/napari/settings/_tests/test_settings.py:15 - A fixture that can be used to test and save settings

Threading & Async Fixtures

Fixture Name Location Scope/Info Description
_auto_shutdown_dask_threadworkers src/napari/conftest.py:237 autouse This automatically shutdown dask thread workers.
delayed_dask_stack src/napari/layers/_tests/test_dask_layers.py:86 - A 4D (20, 10, 10, 10) delayed dask array, simulates disk io.
single_threaded_executor src/napari/conftest.py:537 - Single Threaded Executor

Shapes Layer Fixtures

Fixture Name Location Scope/Info Description
line src/napari/layers/shapes/_tests/conftest.py:542 - Line
line_two_point src/napari/layers/shapes/_tests/conftest.py:547 - Line Two Point
non_convex_poly src/napari/layers/shapes/_tests/conftest.py:536 - Non Convex Poly
poly_hole src/napari/layers/shapes/_tests/conftest.py:552 - Poly Hole
polygons src/napari/layers/shapes/_tests/conftest.py:366 - Polygons
regular_polygon src/napari/layers/shapes/_tests/conftest.py:516 - Regular Polygon
self_intersecting_polygon src/napari/layers/shapes/_tests/conftest.py:526 - Self Intersecting Polygon
single_four_corner src/napari/layers/shapes/_tests/conftest.py:7 - Single Four Corner
single_two_corners src/napari/layers/shapes/_tests/conftest.py:304 - Single Two Corners
ten_four_corner src/napari/layers/shapes/_tests/conftest.py:22 - Ten Four Corner
ten_two_corners src/napari/layers/shapes/_tests/conftest.py:313 - Ten Two Corners
twenty_four_corner src/napari/layers/shapes/_tests/conftest.py:118 - Twenty Four Corner
two_and_four_corners src/napari/layers/shapes/_tests/conftest.py:349 params=4 Two And Four Corners
two_corners src/napari/layers/shapes/_tests/conftest.py:361 params=2 Two Corners

Test Control Fixtures

Fixture Name Location Scope/Info Description
MouseEvent src/napari/utils/_testsupport.py:435 - Create a subclass for simulating vispy mouse events.
_example_monkeypatch src/napari/_tests/test_examples.py:54 - Internal: example monkeypatch
_skip_examples src/napari/conftest.py:176 autouse Skip examples test if .
mock_app_model src/napari/utils/_testsupport.py:143 - Mock clean 'test_app' NapariApplication instance.
mock_run src/napari/_tests/test_cli.py:11 - mock to prevent starting the event loop.

Other Utility Fixtures

Fixture Name Location Scope/Info Description
_disable_jit src/napari/utils/colormaps/_tests/test_colormap.py:166 - Fixture to temporarily disable numba JIT during testing.
colormap_backend src/napari/utils/colormaps/_tests/test_colormap.py:33 autouse Fixture to set the colormap backend for each test.
direct_colormap src/napari/layers/labels/_tests/test_labels.py:35 - Return a DirectLabelColormap.
direct_label_colormap src/napari/utils/colormaps/_tests/test_colormap.py:197 - Direct Label Colormap
pytest_configure src/napari/conftest.py:1047 autouse Pytest Configure
random_colormap src/napari/layers/labels/_tests/test_labels.py:48 - Return a LabelColormap.
test_migrator src/napari/settings/_tests/test_migrations.py:12 - Test Migrator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment