mantidproject / mantidimaging

Graphical toolkit for neutron imaging.
https://mantidproject.github.io/mantidimaging
GNU General Public License v3.0
13 stars 6 forks source link

AttributeError: 'MainWindowView' object has no attribute 'stack_list' #2314

Open samtygier-stfc opened 1 month ago

samtygier-stfc commented 1 month ago

Summary

This warning is seen intermitantly when running pytest

mantidimaging/gui/windows/spectrum_viewer/test/spectrum_test.py::SpectrumWidgetTest::test_WHEN_add_range_called_THEN_region_and_label_set_correctly_2_range_300
  C:\Users\ddb29996\AppData\Local\miniforge3\envs\mantidimaging-dev\Lib\site-packages\_pytest\unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in garbage collection: None

  Traceback (most recent call last):
    File "C:\Users\ddb29996\mantidimaging\mantidimaging\gui\windows\main\view.py", line 493, in stack_names
      @property

  AttributeError: 'MainWindowView' object has no attribute 'stack_list'

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

Steps To Reproduce

pytest mantidimaging/gui/windows/spectrum_viewer/test/spectrum_test.py -W error::UserWarning

Expected Behaviour

No warnings

Current Behaviour

Warnings

Context

Seen on current main

samtygier-stfc commented 1 month ago

Something to investigate would be using a mock instead of a real MainWindowView in SpectrumViewerWindowPresenterTest