Remove use of deprecated APIs
inspect.getargspec is gone in Python 3.11. unittest.TestCase.assertRaisesRegex is preferred to unittest.TestCase.assertRaisesRegexp. Change-Id: Ib6ec492e8c892424ab408a96696df346c3bbfde3 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
16eeb35127
commit
87c586051f
@ -177,13 +177,14 @@ class TestTypes(unittest.TestCase):
|
|||||||
obj.a = 'v1'
|
obj.a = 'v1'
|
||||||
assert obj.a == 'v1', repr(obj.a)
|
assert obj.a == 'v1', repr(obj.a)
|
||||||
|
|
||||||
self.assertRaisesRegexp(exc.InvalidInput,
|
self.assertRaisesRegex(
|
||||||
"Invalid input for field/attribute a. \
|
exc.InvalidInput,
|
||||||
Value: 'v3'. Value should be one of: v., v.",
|
"Invalid input for field/attribute a. "
|
||||||
setattr,
|
"Value: 'v3'. Value should be one of: v., v.",
|
||||||
obj,
|
setattr,
|
||||||
'a',
|
obj,
|
||||||
'v3')
|
'a',
|
||||||
|
'v3')
|
||||||
|
|
||||||
def test_attribute_validation(self):
|
def test_attribute_validation(self):
|
||||||
class AType(object):
|
class AType(object):
|
||||||
|
@ -42,7 +42,7 @@ def signature(*args, **kw):
|
|||||||
sig = wsme.signature(*args, **kw)
|
sig = wsme.signature(*args, **kw)
|
||||||
|
|
||||||
def decorator(f):
|
def decorator(f):
|
||||||
args = inspect.getargspec(f)[0]
|
args = inspect.getfullargspec(f)[0]
|
||||||
ismethod = args and args[0] == 'self'
|
ismethod = args and args[0] == 'self'
|
||||||
sig(f)
|
sig(f)
|
||||||
funcdef = wsme.api.FunctionDefinition.get(f)
|
funcdef = wsme.api.FunctionDefinition.get(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user