def test_builtin_types(self):
     # builtin types must use the default repr()
     assert repr(1) == debug.repr(1)
     assert repr(1.2) == debug.repr(1.2)
     assert repr([1, 2, 3]) == debug.repr([1, 2, 3])
     assert repr({1, 2, 3}) == debug.repr({1, 2, 3})
     assert repr({1, 2, 3}) == debug.repr({1, 2, 3})
     assert repr({'a': 1, 'b': {2, 3}}) == debug.repr({'a': 1, 'b': {2, 3}})
Beispiel #2
0
 def test_builtin_types(self):
     # builtin types must use the default repr()
     self.assertEqual(repr(1), debug.repr(1))
     self.assertEqual(repr(1.2), debug.repr(1.2))
     self.assertEqual(repr([1, 2, 3]), debug.repr([1, 2, 3]))
     self.assertEqual(repr({1, 2, 3}), debug.repr({1, 2, 3}))
     self.assertEqual(repr({1, 2, 3}), debug.repr({1, 2, 3}))
     self.assertEqual(repr({'a': 1, 'b': {2, 3}}),
                      debug.repr({'a': 1, 'b': {2, 3}}))
Beispiel #3
0
 def __repr__(self):
     return debug.repr(self)