Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker_build_test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
- name: Run docker container with tests
shell: bash -l {0}
run: |
docker run --rm --entrypoint /bin/bash -v /home/runner/work/CILViewer/CILViewer:/root/source_code cil-viewer -c "source ./mambaforge/etc/profile.d/conda.sh && conda activate cilviewer_webapp && conda install cil-data pytest pyside2 eqt>=1.0.0 -c ccpi && python -m pytest /root/source_code/Wrappers/Python -k 'not test_version and not test_cli_resample and not test_CILViewerBase and not test_CILViewer3D and not test_viewer_main_windows and not test_ui_dialogs'"
docker run --rm --entrypoint /bin/bash -v /home/runner/work/CILViewer/CILViewer:/root/source_code cil-viewer -c "source ./mambaforge/etc/profile.d/conda.sh && conda activate cilviewer_webapp && conda install cil-data pytest pyside2 eqt>=1.0.0 -c ccpi && python -m pytest /root/source_code/Wrappers/Python -k 'not test_version and not test_cli_resample and not test_viewer_main_windows and not test_ui_dialogs'"
# TODO: publish to come later
12 changes: 7 additions & 5 deletions Wrappers/Python/test/test_CILViewer3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@

from ccpi.viewer.CILViewer import CILViewer

# skip the tests on GitHub actions
if os.environ.get('CONDA_BUILD', '0') == '1':
skip_test = True
else:
skip_test = False
from vtkmodules.vtkRenderingCore import vtkGraphicsFactory

skip_test = False

print("skip_test is set to ", skip_test)

Expand All @@ -33,6 +31,10 @@
class CILViewer3DTest(unittest.TestCase):

def setUp(self):
vgf = vtkGraphicsFactory()
vgf.SetOffScreenOnlyMode(True)
vgf.SetUseMesaClasses(True)
self.vgf = vgf
self.cil_viewer = CILViewer()

def test_getGradientOpacityPercentiles_returns_correct_percentiles_when_image_values_start_at_zero(self):
Expand Down
12 changes: 7 additions & 5 deletions Wrappers/Python/test/test_CILViewerBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
import os

from ccpi.viewer.CILViewer import CILViewerBase
from vtkmodules.vtkRenderingCore import vtkGraphicsFactory

# skip the tests on GitHub actions
if os.environ.get('CONDA_BUILD', '0') == '1':
skip_test = True
else:
skip_test = False
skip_test = False

print("skip_test is set to ", skip_test)

Expand All @@ -34,6 +31,10 @@ class CILViewerBaseTest(unittest.TestCase):

def setUp(self):
'''Creates an instance of the CIL viewer base class.'''
vgf = vtkGraphicsFactory()
vgf.SetOffScreenOnlyMode(True)
vgf.SetUseMesaClasses(True)
self.vgf = vgf
self.CILViewerBase_instance = CILViewerBase()

def test_setAxisLabels(self):
Expand All @@ -56,6 +57,7 @@ def test_setAxisLabels(self):
class CILViewer3DTest(unittest.TestCase):

def setUp(self):
vgf = vtkGraphicsFactory(off_screen_only_mode=True, use_mesa_classes=True)
self.cil_viewer = CILViewerBase()

def test_getSliceColorPercentiles_returns_correct_percentiles_when_slice_values_start_at_zero(self):
Expand Down
Loading