Commit e68f5573 authored by Jérome Perrin's avatar Jérome Perrin

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

!1751 (comment 203735)
parent 5194fa6e
......@@ -572,6 +572,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# otherwise it returns the object
self.assertEqual(obj, portal_catalog.getObject(obj.getUid()).getObject())
# but raises KeyError if object is not in catalog
self.assertRaises(KeyError, portal_catalog.getObject, sys.maxsize)
self.assertRaises(KeyError, portal_catalog.getObject, -1)
def test_getRecordForUid(self):
......@@ -584,6 +585,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog = self.getCatalogTool()
obj = self._makeOrganisation()
self.assertEqual(obj.getPath(), portal_catalog.getpath(obj.getUid()))
self.assertRaises(KeyError, portal_catalog.getpath, sys.maxsize)
self.assertRaises(KeyError, portal_catalog.getpath, -1)
def test_16_newUid(self):
......
......@@ -148,7 +148,7 @@ class SavedTestSuite(ERP5TypeTestSuite):
def __init__(self, *args, **kw):
# Use same portal id for all tests run by current instance
# 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
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