FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-105751: Remove obsolete `object` base class in some ctypes tests by tomasr8 · Pull Request #107460 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 3 additions & 3 deletions Lib/test/test_ctypes/test_as_parameter.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class S8I(Structure):
(9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))

def test_recursive_as_param(self):
class A(object):
class A:
pass

a = A()
Expand All @@ -201,15 +201,15 @@ class A(object):
c_int.from_param(a)


class AsParamWrapper(object):
class AsParamWrapper:
def __init__(self, param):
self._as_parameter_ = param

class AsParamWrapperTestCase(BasicWrapTestCase):
wrap = AsParamWrapper


class AsParamPropertyWrapper(object):
class AsParamPropertyWrapper:
def __init__(self, param):
self._param = param

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_ctypes/test_callbacks.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_unsupported_restype_2(self):
def test_issue_7959(self):
proto = self.functype.__func__(None)

class X(object):
class X:
def func(self): pass
def __init__(self):
self.v = proto(self.func)
Expand Down
8 changes: 4 additions & 4 deletions Lib/test/test_ctypes/test_numbers.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_byref(self):
def test_floats(self):
# c_float and c_double can be created from
# Python int and float
class FloatLike(object):
class FloatLike:
def __float__(self):
return 2.0
f = FloatLike()
Expand All @@ -97,15 +97,15 @@ def __float__(self):
self.assertEqual(t(f).value, 2.0)

def test_integers(self):
class FloatLike(object):
class FloatLike:
def __float__(self):
return 2.0
f = FloatLike()
class IntLike(object):
class IntLike:
def __int__(self):
return 2
d = IntLike()
class IndexLike(object):
class IndexLike:
def __index__(self):
return 2
i = IndexLike()
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_ctypes/test_parameters.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ def test_noctypes_argtype(self):
# TypeError: has no from_param method
self.assertRaises(TypeError, setattr, func, "argtypes", (object,))

class Adapter(object):
class Adapter:
def from_param(cls, obj):
return None

func.argtypes = (Adapter(),)
self.assertEqual(func(None), None)
self.assertEqual(func(object()), None)

class Adapter(object):
class Adapter:
def from_param(cls, obj):
return obj

Expand All @@ -174,7 +174,7 @@ def from_param(cls, obj):
self.assertRaises(ArgumentError, func, object())
self.assertEqual(func(c_void_p(42)), 42)

class Adapter(object):
class Adapter:
def from_param(cls, obj):
raise ValueError(obj)

Expand Down

Back | FazBrowse Home | New Git URL