def test_pickling(self): from psycopg2.extras import Range r = Range(0, 4) self.assertEqual(loads(dumps(r)), r)