##// END OF EJS Templates
fix count when testing composite error output
MinRK -
Show More
@@ -615,12 +615,15 b' class TestView(ClusterTestCase, ParametricTestCase):'
615 615 ar = view.execute("1/0")
616 616 ip = get_ipython()
617 617 ip.user_ns['ar'] = ar
618
618 619 with capture_output() as io:
619 620 ip.run_cell("ar.get(2)")
620 621
621 self.assertEqual(io.stdout.count('ZeroDivisionError'), len(view) * 2, io.stdout)
622 self.assertEqual(io.stdout.count('by zero'), len(view), io.stdout)
623 self.assertEqual(io.stdout.count(':execute'), len(view), io.stdout)
622 count = min(error.CompositeError.tb_limit, len(view))
623
624 self.assertEqual(io.stdout.count('ZeroDivisionError'), count * 2, io.stdout)
625 self.assertEqual(io.stdout.count('by zero'), count, io.stdout)
626 self.assertEqual(io.stdout.count(':execute'), count, io.stdout)
624 627
625 628 def test_compositeerror_truncate(self):
626 629 """Truncate CompositeErrors with many exceptions"""
General Comments 0
You need to be logged in to leave comments. Login now