From 2536bea619e2432eb29599d56956a60c0b04e91e Mon Sep 17 00:00:00 2001 From: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:18:03 +0100 Subject: [PATCH] Added xfail to tests that fail due to logging bug (#444) * Added xfail to tests that fail due to logging bug * Added more details to the xfail call --- tests/napari/test_curation.py | 7 +++++++ tests/napari/test_detection.py | 2 ++ tests/napari/test_training.py | 3 +++ tests/napari/test_utils.py | 2 ++ 4 files changed, 14 insertions(+) diff --git a/tests/napari/test_curation.py b/tests/napari/test_curation.py index f52141cc..beecb8c4 100644 --- a/tests/napari/test_curation.py +++ b/tests/napari/test_curation.py @@ -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 @@ -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. @@ -130,6 +132,7 @@ 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. @@ -137,6 +140,7 @@ def test_check_image_data_for_extraction(valid_curation_widget): 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 @@ -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 @@ -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( diff --git a/tests/napari/test_detection.py b/tests/napari/test_detection.py index ea7c6fb5..79650426 100644 --- a/tests/napari/test_detection.py +++ b/tests/napari/test_detection.py @@ -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 @@ -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() diff --git a/tests/napari/test_training.py b/tests/napari/test_training.py index 48ce1139..49523fa5 100644 --- a/tests/napari/test_training.py +++ b/tests/napari/test_training.py @@ -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. @@ -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 @@ -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. diff --git a/tests/napari/test_utils.py b/tests/napari/test_utils.py index 6cf864f3..fa5e7a02 100644 --- a/tests/napari/test_utils.py +++ b/tests/napari/test_utils.py @@ -1,4 +1,5 @@ import numpy as np +import pytest from brainglobe_utils.cells.cells import Cell from cellfinder.napari.utils import ( @@ -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]