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')" )
def get_repr(obj, limit=250): return cgi.escape(reftree.get_repr(obj, limit))
def test_get_repr_unrepresentable(self): self.assertEqual( get_repr(Unrepresentable()), "unrepresentable object: Exception('haha you cannot represent me',)")
def test_get_repr_unrepresentable(self): self.assertEqual( get_repr(Unrepresentable()), "unrepresentable object: Exception('haha you cannot represent me',)" )