Commit 8193cac0 authored by Jérome Perrin's avatar Jérome Perrin

py2/py3: use sys.maxsize instead of sys.maxint

!1751 (comment 203735)
parent 935b75d0
...@@ -572,6 +572,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -572,6 +572,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# otherwise it returns the object # otherwise it returns the object
self.assertEqual(obj, portal_catalog.getObject(obj.getUid()).getObject()) self.assertEqual(obj, portal_catalog.getObject(obj.getUid()).getObject())
# but raises KeyError if object is not in catalog # but raises KeyError if object is not in catalog
self.assertRaises(KeyError, portal_catalog.getObject, sys.maxsize)
self.assertRaises(KeyError, portal_catalog.getObject, -1) self.assertRaises(KeyError, portal_catalog.getObject, -1)
def test_getRecordForUid(self): def test_getRecordForUid(self):
...@@ -584,6 +585,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -584,6 +585,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
obj = self._makeOrganisation() obj = self._makeOrganisation()
self.assertEqual(obj.getPath(), portal_catalog.getpath(obj.getUid())) self.assertEqual(obj.getPath(), portal_catalog.getpath(obj.getUid()))
self.assertRaises(KeyError, portal_catalog.getpath, sys.maxsize)
self.assertRaises(KeyError, portal_catalog.getpath, -1) self.assertRaises(KeyError, portal_catalog.getpath, -1)
def test_16_newUid(self): def test_16_newUid(self):
......
...@@ -148,7 +148,7 @@ class SavedTestSuite(ERP5TypeTestSuite): ...@@ -148,7 +148,7 @@ class SavedTestSuite(ERP5TypeTestSuite):
def __init__(self, *args, **kw): def __init__(self, *args, **kw):
# Use same portal id for all tests run by current instance # Use same portal id for all tests run by current instance
# but keep it (per-run) random. # but keep it (per-run) random.
self._portal_id = 'portal_%i' % (random.randint(0, 2**64), ) self._portal_id = 'portal_%i' % (random.randint(0, sys.maxsize), )
self._setup_failed = False self._setup_failed = False
super(SavedTestSuite, self).__init__(*args, **kw) super(SavedTestSuite, self).__init__(*args, **kw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment