Commits

Armin Rigo  committed 9b9f26c

Bah. An issue with py.test error reporting is that if these return generators,
then they are exhausted by the time it does assert re-evaluation, and we get
confusing messages. (I know it's ultimately my own fault, not blaming anyone
else here :-)

  • Participants
  • Parent commits b4acd9a
  • Branches out-of-line-guards-2

Comments (0)

Files changed (1)

File pypy/module/pypyjit/test_pypy_c/model.py

             if op.name != 'debug_merge_point' or include_debug_merge_points:
                 yield op
 
-    def allops(self, include_debug_merge_points=False, opcode=None):
+    def _allops(self, include_debug_merge_points=False, opcode=None):
         opcode_name = opcode
         for chunk in self.flatten_chunks():
             opcode = chunk.getopcode()                                                          
                 for op in self._ops_for_chunk(chunk, include_debug_merge_points):
                     yield op
 
+    def allops(self, *args, **kwds):
+        return list(self._allops(*args, **kwds))
+
     def format_ops(self, id=None, **kwds):
         if id is None:
             ops = self.allops(**kwds)
     def print_ops(self, *args, **kwds):
         print self.format_ops(*args, **kwds)
 
-    def ops_by_id(self, id, include_debug_merge_points=False, opcode=None):
+    def _ops_by_id(self, id, include_debug_merge_points=False, opcode=None):
         opcode_name = opcode
         target_opcodes = self.ids[id]
         for chunk in self.flatten_chunks():
                 for op in self._ops_for_chunk(chunk, include_debug_merge_points):
                     yield op
 
+    def ops_by_id(self, *args, **kwds):
+        return list(self._ops_by_id(*args, **kwds))
+
     def match(self, expected_src, **kwds):
         ops = list(self.allops())
         matcher = OpMatcher(ops, src=self.format_ops())