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'
|
||||
assert obj.a == 'v1', repr(obj.a)
|
||||
|
||||
self.assertRaisesRegexp(exc.InvalidInput,
|
||||
"Invalid input for field/attribute a. \
|
||||
Value: 'v3'. Value should be one of: v., v.",
|
||||
setattr,
|
||||
obj,
|
||||
'a',
|
||||
'v3')
|
||||
self.assertRaisesRegex(
|
||||
exc.InvalidInput,
|
||||
"Invalid input for field/attribute a. "
|
||||
"Value: 'v3'. Value should be one of: v., v.",
|
||||
setattr,
|
||||
obj,
|
||||
'a',
|
||||
'v3')
|
||||
|
||||
def test_attribute_validation(self):
|
||||
class AType(object):
|
||||
|
@ -42,7 +42,7 @@ def signature(*args, **kw):
|
||||
sig = wsme.signature(*args, **kw)
|
||||
|
||||
def decorator(f):
|
||||
args = inspect.getargspec(f)[0]
|
||||
args = inspect.getfullargspec(f)[0]
|
||||
ismethod = args and args[0] == 'self'
|
||||
sig(f)
|
||||
funcdef = wsme.api.FunctionDefinition.get(f)
|
||||
|
Loading…
Reference in New Issue
Block a user