Skip to content

Commit

Permalink
Added xfail to tests that fail due to logging bug (#444)
Browse files Browse the repository at this point in the history
* Added xfail to tests that fail due to logging bug

* Added more details to the xfail call
  • Loading branch information
IgorTatarnikov authored Jul 19, 2024
1 parent 71d17ee commit 2536bea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/napari/test_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def curation_widget(make_napari_viewer):
return widget


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_add_new_training_layers(curation_widget):
viewer = curation_widget.viewer
layers = viewer.layers
Expand All @@ -38,6 +39,7 @@ def test_add_new_training_layers(curation_widget):
assert layers[1].name == "Training data (non cells)"


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_cell_marking(curation_widget, tmp_path):
"""
Check that marking cells and non-cells works as expected.
Expand Down Expand Up @@ -130,13 +132,15 @@ def valid_curation_widget(make_napari_viewer) -> CurationWidget:
return curation_widget


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_check_image_data_for_extraction(valid_curation_widget):
"""
Check valid curation widget has extractable data.
"""
assert valid_curation_widget.check_image_data_for_extraction()


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_check_image_data_wrong_shape(valid_curation_widget):
"""
Check curation widget shows expected user message if images don't have
Expand All @@ -156,6 +160,7 @@ def test_check_image_data_wrong_shape(valid_curation_widget):
)


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_check_image_data_missing_signal(valid_curation_widget):
"""
Check curation widget shows expected user message if signal image is
Expand All @@ -170,12 +175,14 @@ def test_check_image_data_missing_signal(valid_curation_widget):
)


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_is_data_extractable(curation_widget, valid_curation_widget):
"""Check is_data_extractable works as expected."""
assert not curation_widget.is_data_extractable()
assert valid_curation_widget.is_data_extractable()


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_get_output_directory(valid_curation_widget):
"""Check get_output_directory returns expected value."""
with patch(
Expand Down
2 changes: 2 additions & 0 deletions tests/napari/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_detect_worker():
worker.work()


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
@pytest.mark.parametrize(
argnames="analyse_local",
argvalues=[True, False], # increase test coverage by covering both cases
Expand All @@ -67,6 +68,7 @@ def test_run_detect_without_inputs():
assert show_info.called


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_reset_defaults(get_detect_widget):
"""Smoke test that restore defaults doesn't error."""
get_detect_widget.reset_button.clicked()
3 changes: 3 additions & 0 deletions tests/napari/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_training_widget(make_napari_viewer):
return widget


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_reset_to_defaults(get_training_widget):
"""
A simple test for the reset button.
Expand All @@ -45,6 +46,7 @@ def test_reset_to_defaults(get_training_widget):
assert get_training_widget.test_fraction.value == 0.10


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_run_with_no_yaml_files(get_training_widget):
"""
Checks whether expected info message will be shown to user if they don't
Expand All @@ -57,6 +59,7 @@ def test_run_with_no_yaml_files(get_training_widget):
)


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_run_with_virtual_yaml_files(get_training_widget):
"""
Checks that training is run with expected set of parameters.
Expand Down
2 changes: 2 additions & 0 deletions tests/napari/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import pytest
from brainglobe_utils.cells.cells import Cell

from cellfinder.napari.utils import (
Expand All @@ -10,6 +11,7 @@
)


@pytest.mark.xfail(reason="See discussion in #443", raises=AssertionError)
def test_add_classified_layers(make_napari_viewer):
"""Smoke test for add_classified_layers utility"""
cell_pos = [1, 2, 3]
Expand Down

0 comments on commit 2536bea

Please sign in to comment.