Commits

Ronny Pfannschmidt  committed 23c11f6

add the beginnings of a detailed per file failures view

  • Participants
  • Parent commits 0306e0f

Comments (0)

Files changed (2)

File pytest_gui/gtkui/filefails.py

+'''
+detailed information on thefailures within a file
+'''
+
+from pygtkhelpers.ui.objectlist import ObjectList, Column
+from pygtkhelpers.delegates import WindowView
+
+
+class FileFailView(WindowView):
+    fileentry = None
+
+    def create_ui(self):
+        self.collection = ObjectList([
+            Column('nodeid', data_func=lambda x:x.split('::', 1)[-1]),
+        ])
+
+    def set_entry(self, fileentry):
+        if self.fileentry:
+            del self.fileentry.view
+        self.collection.clear()
+        self.fileentry = fileentry
+        if fileentry:
+            fileentry.view = self
+            self.collection.extend(fileentry.reports)

File testing/gtk/test_filefails.py

+from .test_gtkui import mock_report
+from pytest_gui.gtkui.runstate import FileEntry
+from pytest_gui.gtkui.filefails import FileFailView
+
+
+def test_simple_failures():
+    view = FileFailView()
+    entry = FileEntry('a.py')
+    view.set_entry(entry)
+    assert entry.view is view