Commits

Ronny Pfannschmidt committed 980f80e

complete the failed file listing

  • Participants
  • Parent commits f2cf204

Comments (0)

Files changed (2)

File pytest_gui/gtkui/runstate.py

     def add_report(self, report):
         self.reports.append(report)
 
+    @property
+    def interesting(self):
+        return any(rep.outcome != 'passed' for rep in self.reports)
+
 
 class RunStateView(SlaveView):
 
         self.file_listing = ObjectList([
             Column('filename'),
         ])
-
+        self.file_listing.set_visible_func(lambda x: x.interesting)
         self.widget.add(self.file_listing)
 
     def set_tests(self, test_ids):
         pass
 
     def handle_report(self, report):
+        file = report.nodeid.split('::')[0]
+        entry = self.file_enries[file]
+        entry.add_report(report)
+        self.file_listing.update(entry)
         self.stats.setdefault(report.outcome, []).append(report)
         if report.outcome not in ('passed', 'skipped'):
             #XXX add fail file

File testing/gtk/test_gtkui.py

     label_text = rsv.run_stat_label.get_text()
     assert label_text == '2/4 executed 1 passed 1 failed'
 
-    assert rsv.file_listing[0].filename == 'test_foo.py'
+    assert rsv.file_enries['test_foo.py'].interesting