From 1979c8115212434c30101da3bdc302bfecde0b77 Mon Sep 17 00:00:00 2001 From: Toru Seo <34780089+toruseo@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:41:27 +0900 Subject: [PATCH] test update? --- .github/workflows/test-gui.yml | 4 ++-- tests/test_result_gui_viewer.py | 8 +++++--- uxsim/ResultGUIViewer/ResultGUIViewer.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-gui.yml b/.github/workflows/test-gui.yml index 786890e..2ae8a43 100644 --- a/.github/workflows/test-gui.yml +++ b/.github/workflows/test-gui.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.9" - name: Install uxsim and dependencies run: pip install . - name: Install pytest other dependencies diff --git a/tests/test_result_gui_viewer.py b/tests/test_result_gui_viewer.py index c673209..50eb929 100644 --- a/tests/test_result_gui_viewer.py +++ b/tests/test_result_gui_viewer.py @@ -13,8 +13,8 @@ def test_result_gui_viewer(): name="", # Scenario name deltan=5, # Simulation aggregation unit delta n tmax=1200, # Total simulation time (s) - print_mode=1, save_mode=1, show_mode=1, # Various options - random_seed=0 # Set the random seed + print_mode=0, save_mode=0, show_mode=0, # Various options + random_seed=None # Set the random seed ) # Define the scenario @@ -43,4 +43,6 @@ def test_result_gui_viewer(): timer = QTimer() timer.timeout.connect(window.close) timer.start(1000*5) - sys.exit(app.exec_()) \ No newline at end of file + assert True + with pytest.raises(SystemExit): + sys.exit(app.exec_()) \ No newline at end of file diff --git a/uxsim/ResultGUIViewer/ResultGUIViewer.py b/uxsim/ResultGUIViewer/ResultGUIViewer.py index 723c2d4..36b2c3a 100644 --- a/uxsim/ResultGUIViewer/ResultGUIViewer.py +++ b/uxsim/ResultGUIViewer/ResultGUIViewer.py @@ -60,7 +60,7 @@ def paint(self, painter, option, widget): c = colormaps["viridis"](speed/self.Link.u) #color = QColor(int(density/self.Link.jam_density * 255), int(density/self.Link.jam_density * 255), 0, 255) - color = QColor(c[0]*255, c[1]*255, c[2]*255, 255) + color = QColor(int(c[0]*255), int(c[1]*255), int(c[2]*255), 255) pen = QPen(color, lw) painter.setPen(pen)