Skip to content

Commit

Permalink
Set up in PyCharm with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrabru committed Oct 24, 2024
1 parent e4cd20f commit c7f24b5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ line-length = 79

[tool.isort]
profile = "black"
line_length = 79
line_length = 79

File renamed without changes.
2 changes: 0 additions & 2 deletions src/napari_polcam/_tests/test_widget.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/napari_polcam/napari.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: napari-polcam
display_name: napari PolCam
display_name: napari-polcam
contributions:
commands:
- id: napari-polcam.make_stokes_qwidget
Expand Down
Empty file added tests/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions tests/test_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# tests/test_widget.py

import pytest
from napari_polcam import StokesEstimation


# Using the napari viewer fixture
@pytest.mark.qt
def test_stokes_initialization(make_napari_viewer):
# Create a real napari viewer instance
viewer = make_napari_viewer()

# Initialize the StokesEstimation widget with the real viewer
widget = StokesEstimation(napari_viewer=viewer)

# Check that the widget was created successfully
assert widget is not None

0 comments on commit c7f24b5

Please sign in to comment.