Skip to content

Commit

Permalink
auto test WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomaubier committed Jan 27, 2025
1 parent e79e987 commit 6810922
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
run: pip install pytest nbmake

- name: Testing CoperniFUS
run: pytest --nbmake tests/ipynb_test.ipynb
run: pytest tests/test_viewer.py
5 changes: 3 additions & 2 deletions coperniFUS/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ class Window(pyqtw.QMainWindow):
def __init__(self, app, assets_dir_path='', **kwargs) -> None:
self.assets_dir_path = pathlib.Path(assets_dir_path)
self.app_kwargs = kwargs
self.app = app
self.app.setStyle('Fusion')
if app is not None: # ignore app when running tests
self.app = app
self.app.setStyle('Fusion')
super().__init__()

self.debug_trihedras = []
Expand Down
67 changes: 0 additions & 67 deletions tests/ipynb_test.ipynb

This file was deleted.

12 changes: 12 additions & 0 deletions tests/test_viewer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest
from coperniFUS.viewer import Window, pyqtw

@pytest.fixture
def viewer_window(qtbot):
"""Fixture to create CoperniFUS viewer window."""
window = Window(app=None)
return window

def test_window_title(viewer_window):
"""Test the window title."""
assert viewer_window.windowTitle() == "CoperniFUS"

0 comments on commit 6810922

Please sign in to comment.