File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
packages/google-cloud-ndb Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2272,7 +2272,7 @@ def _validate(self, value):
22722272 .BadValueError: If ``value`` is not an :class:`int` or convertible
22732273 to one.
22742274 """
2275- if not isinstance (value , int ):
2275+ if not isinstance (value , six . integer_types ):
22762276 raise exceptions .BadValueError (
22772277 "Expected integer, got {!r}" .format (value )
22782278 )
Original file line number Diff line number Diff line change @@ -1517,6 +1517,13 @@ def test__validate():
15171517 value = 829038402384
15181518 assert prop ._validate (value ) is value
15191519
1520+ @staticmethod
1521+ @pytest .mark .skipif (six .PY3 , reason = "Test for Python 2 only." )
1522+ def test__validate_long (): # pragma: NO PY3 COVER
1523+ prop = model .IntegerProperty (name = "count" )
1524+ value = long (829038402384 ) # noqa F821
1525+ assert prop ._validate (value ) is not value
1526+
15201527 @staticmethod
15211528 def test__validate_bool ():
15221529 prop = model .IntegerProperty (name = "count" )
You can’t perform that action at this time.
0 commit comments