Skip to content

Commit

Permalink
Stop controller during app teardown (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbruno25 authored Jul 11, 2024
1 parent aec363f commit cc27f6b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dearpygui-ext = "^0.9.5"

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.2"
pytest-order = "^1.2.1"
mypy = "^1.2.0"
pillow = "^10.3.0"
pyautogui = "^0.9.54"
Expand Down
5 changes: 3 additions & 2 deletions src/can_explorer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def setup(self):

dpg.set_primary_window(app, True)

@staticmethod
def teardown():
def teardown(self):
if self.controller.is_active():
self.controller.stop()
dpg.destroy_context()

def exception_handler(self, exc_type, exc_value, exc_traceback):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def test_controller_populates_data_in_ascending_order(controller, view, vbus1, v

time.sleep(0.1)
plots = view.plot.get_rows()
assert list(plots) == sorted(plots)
assert plots and list(plots) == sorted(plots)
2 changes: 0 additions & 2 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from tests.resources import WITHIN_CI
from tests.resources.gui_components import Gui

pytestmark = pytest.mark.order(1)

if HOST_OS == "linux":
import Xlib.display
from pyvirtualdisplay.smartdisplay import SmartDisplay
Expand Down

0 comments on commit cc27f6b

Please sign in to comment.