delete inspect.getargspect() as is deprecated since Python 3.0

This commit is contained in:
marc 2019-12-14 19:52:17 +01:00
parent a176ff77bc
commit d42f5a41a5
1 changed files with 1 additions and 4 deletions

View File

@ -468,10 +468,7 @@ reporttypes = [reports.BaseReport, reports.TestReport, reports.CollectReport]
"reporttype", reporttypes, ids=[x.__name__ for x in reporttypes] "reporttype", reporttypes, ids=[x.__name__ for x in reporttypes]
) )
def test_report_extra_parameters(reporttype): def test_report_extra_parameters(reporttype):
if hasattr(inspect, "signature"):
args = list(inspect.signature(reporttype.__init__).parameters.keys())[1:] args = list(inspect.signature(reporttype.__init__).parameters.keys())[1:]
else:
args = inspect.getargspec(reporttype.__init__)[0][1:]
basekw = dict.fromkeys(args, []) basekw = dict.fromkeys(args, [])
report = reporttype(newthing=1, **basekw) report = reporttype(newthing=1, **basekw)
assert report.newthing == 1 assert report.newthing == 1