Example #1
0
 def test_get_repr_unrepresentable(self):
     # repr(Exception('foo')) is "Exception('foo',)" on Python < 3.7
     # repr(Exception('foo')) is "Exception('foo')" on Python >= 3.7
     self.assertEqual(
         get_repr(Unrepresentable()).replace(',)', ')'),
         "unrepresentable object: Exception('haha you cannot represent me')"
     )
Example #2
0
def get_repr(obj, limit=250):
    return cgi.escape(reftree.get_repr(obj, limit))
Example #3
0
def get_repr(obj, limit=250):
    return cgi.escape(reftree.get_repr(obj, limit))
Example #4
0
 def test_get_repr_unrepresentable(self):
     self.assertEqual(
         get_repr(Unrepresentable()),
         "unrepresentable object: Exception('haha you cannot represent me',)")
Example #5
0
 def test_get_repr_unrepresentable(self):
     self.assertEqual(
         get_repr(Unrepresentable()),
         "unrepresentable object: Exception('haha you cannot represent me',)"
     )