Commits

Ronny Pfannschmidt committed 0306e0f

add a simple test for the run view

  • Participants
  • Parent commits 417bc3e

Comments (0)

Files changed (2)

File testing/gtk/__init__.py

Empty file added.

File testing/gtk/test_run_view.py

+import mock
+from .test_gtkui import mock_report
+
+from pytest_gui.gtkui.runstate import RunStateView
+
+
+def test_fail_makes_visible():
+    rs = RunStateView()
+    rs.set_tests([
+        'a.py::a',
+        'a.py::b',
+        'b.py::b',
+    ])
+    assert rs.file_listing[0].filename == 'a.py'
+    assert rs.file_listing[1].filename == 'b.py'
+    assert len(rs.file_listing.model_filter) == 0
+    rs.handle_report(mock_report(nodeid='a.py::a', outcome='failed'))
+    assert rs.file_listing[0].reports
+    assert len(rs.file_listing.model_filter) == 1