diff options
author | Tomas R <tomas.roun8@gmail.com> | 2023-07-31 12:48:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-31 12:48:27 (GMT) |
commit | 520efecfc3aed34d3a44545c7cd872d1aea8c7dc (patch) | |
tree | e644334bb4ad23d8dd3f086335be9a3c7b9786d3 /Lib | |
parent | f57b9fd2b6b403e59dcd7f86a0943d61d79e5768 (diff) | |
download | cpython-520efecfc3aed34d3a44545c7cd872d1aea8c7dc.zip cpython-520efecfc3aed34d3a44545c7cd872d1aea8c7dc.tar.gz cpython-520efecfc3aed34d3a44545c7cd872d1aea8c7dc.tar.bz2 |
gh-105751: Remove obsolete `object` base class in some ctypes tests (#107460)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_ctypes/test_as_parameter.py | 6 | ||||
-rw-r--r-- | Lib/test/test_ctypes/test_callbacks.py | 2 | ||||
-rw-r--r-- | Lib/test/test_ctypes/test_numbers.py | 8 | ||||
-rw-r--r-- | Lib/test/test_ctypes/test_parameters.py | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_ctypes/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py index 39f70e8..a1a8745 100644 --- a/Lib/test/test_ctypes/test_as_parameter.py +++ b/Lib/test/test_ctypes/test_as_parameter.py @@ -192,7 +192,7 @@ class BasicWrapTestCase(unittest.TestCase): (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() @@ -201,7 +201,7 @@ class BasicWrapTestCase(unittest.TestCase): c_int.from_param(a) -class AsParamWrapper(object): +class AsParamWrapper: def __init__(self, param): self._as_parameter_ = param @@ -209,7 +209,7 @@ class AsParamWrapperTestCase(BasicWrapTestCase): wrap = AsParamWrapper -class AsParamPropertyWrapper(object): +class AsParamPropertyWrapper: def __init__(self, param): self._param = param diff --git a/Lib/test/test_ctypes/test_callbacks.py b/Lib/test/test_ctypes/test_callbacks.py index 037677e..6fe3e11 100644 --- a/Lib/test/test_ctypes/test_callbacks.py +++ b/Lib/test/test_ctypes/test_callbacks.py @@ -120,7 +120,7 @@ class Callbacks(unittest.TestCase): 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) diff --git a/Lib/test/test_ctypes/test_numbers.py b/Lib/test/test_ctypes/test_numbers.py index fd318f9..29108a2 100644 --- a/Lib/test/test_ctypes/test_numbers.py +++ b/Lib/test/test_ctypes/test_numbers.py @@ -86,7 +86,7 @@ class NumberTestCase(unittest.TestCase): 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() @@ -97,15 +97,15 @@ class NumberTestCase(unittest.TestCase): 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() diff --git a/Lib/test/test_ctypes/test_parameters.py b/Lib/test/test_ctypes/test_parameters.py index 4097921..d1eeee6 100644 --- a/Lib/test/test_ctypes/test_parameters.py +++ b/Lib/test/test_ctypes/test_parameters.py @@ -157,7 +157,7 @@ class SimpleTypesTestCase(unittest.TestCase): # 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 @@ -165,7 +165,7 @@ class SimpleTypesTestCase(unittest.TestCase): self.assertEqual(func(None), None) self.assertEqual(func(object()), None) - class Adapter(object): + class Adapter: def from_param(cls, obj): return obj @@ -174,7 +174,7 @@ class SimpleTypesTestCase(unittest.TestCase): 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) |