1.12.1: pytest deprecations warnings
Below is without patch quoted in https://github.com/GrahamDumpleton/wrapt/issues/178
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
Using --randomly-seed=3534959762
rootdir: /home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1, configfile: tox.ini
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, randomly-3.8.0, pyfakefs-4.5.0, hypothesis-6.13.14
collected 375 items
tests/test_arguments.py .. [ 0%]
tests/test_synchronized_lock.py ......... [ 2%]
tests/test_weak_function_proxy.py .......... [ 5%]
tests/test_instancemethod.py ................................. [ 14%]
tests/test_class_py37.py ... [ 15%]
tests/test_callable_object_proxy.py ...... [ 16%]
tests/test_attribute_wrapper.py . [ 17%]
tests/test_nested_function.py ....... [ 18%]
tests/test_function.py ........ [ 21%]
tests/test_class.py .. [ 21%]
tests/test_adapter_py33.py .. [ 22%]
tests/test_function_wrapper.py .............................. [ 30%]
tests/test_memoize.py .... [ 31%]
tests/test_decorators.py ..... [ 32%]
tests/test_monkey_patching.py ..............F.. [ 37%]
tests/test_update_attributes.py .......... [ 39%]
tests/test_adapter.py ........... [ 42%]
. . [ 42%]
tests/test_inner_classmethod.py ................ [ 47%]
tests/test_copy.py .... [ 48%]
tests/test_outer_staticmethod.py .............. [ 52%]
tests/test_pickle.py .. [ 52%]
tests/test_outer_classmethod.py .............. [ 56%]
tests/test_post_import_hooks.py ... [ 57%]
tests/test_inner_staticmethod.py .................. [ 61%]
tests/test_object_proxy.py ......................................................................................................................................... [ 98%]
...... [100%]
================================================================================= FAILURES =================================================================================
___________________________________________________________ TestMonkeyPatching.test_wrap_class_method_inherited ____________________________________________________________
self = <test_monkey_patching.TestMonkeyPatching testMethod=test_wrap_class_method_inherited>
def test_wrap_class_method_inherited(self):
_args = (1, 2)
_kwargs = {'one': 1, 'two': 2}
called = []
def wrapper(wrapped, instance, args, kwargs):
called.append((args, kwargs))
self.assertEqual(args, _args)
self.assertEqual(kwargs, _kwargs)
return wrapped(*args, **kwargs)
wrapt.wrap_function_wrapper(__name__, 'Class_2_1.method',
wrapper)
> result = Class_2_1.method(*_args, **_kwargs)
tests/test_monkey_patching.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_monkey_patching.py:221: in wrapper
return wrapped(*args, **kwargs)
tests/test_monkey_patching.py:198: in wrapper
self.assertEqual(instance, Class_2)
E AssertionError: <class 'test_monkey_patching.Class_2_1'> != <class 'test_monkey_patching.Class_2'>
============================================================================= warnings summary =============================================================================
tests/conftest.py:7
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/conftest.py:7: PytestDeprecationWarning: pytest.collect.File was moved to pytest.File
Please update to the new name.
class DummyCollector(pytest.collect.File):
tests/test_instancemethod.py::TestNamingInstanceMethodNewStyle::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:208: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(NewClass1o().function)
tests/test_instancemethod.py::TestNamingInstanceMethodNewStyle::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:209: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(NewClass1d().function)
tests/test_instancemethod.py::TestNamingInstanceMethodNewStyle::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:201: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(NewClass1o.function)
tests/test_instancemethod.py::TestNamingInstanceMethodNewStyle::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:202: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(NewClass1d.function)
tests/test_instancemethod.py::TestNamingInstanceMethodOldStyle::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:98: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(OldClass1o.function)
tests/test_instancemethod.py::TestNamingInstanceMethodOldStyle::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:99: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(OldClass1d.function)
tests/test_instancemethod.py::TestNamingInstanceMethodOldStyle::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:105: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(OldClass1o().function)
tests/test_instancemethod.py::TestNamingInstanceMethodOldStyle::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_instancemethod.py:106: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(OldClass1d().function)
tests/test_nested_function.py::TestNamingNestedFunction::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_nested_function.py:69: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function1o_argspec = inspect.getargspec(function1o())
tests/test_nested_function.py::TestNamingNestedFunction::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_nested_function.py:70: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function1d_argspec = inspect.getargspec(function1d())
tests/test_function.py::TestNamingFunction::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_function.py:60: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function1o_argspec = inspect.getargspec(function1o)
tests/test_function.py::TestNamingFunction::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_function.py:61: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function1d_argspec = inspect.getargspec(function1d)
tests/test_adapter.py::TestArgumentSpecification::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:75: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function1a_argspec = inspect.getargspec(_adapter)
tests/test_adapter.py::TestArgumentSpecification::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:76: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function1d_argspec = inspect.getargspec(function1d)
tests/test_adapter.py::TestArgumentSpecification::test_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:83: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
bound_function1d_argspec = inspect.getargspec(bound_function1d)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:172: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
argspec = inspect.getargspec(_adapter)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_function
tests/test_adapter.py::TestDynamicAdapter::test_adapter_factory
/home/tkloczko/rpmbuild/BUILDROOT/python-wrapt-1.12.1-6.fc35.x86_64/usr/lib64/python3.8/site-packages/wrapt/decorators.py:210: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
adapter = formatargspec(*adapter)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:186: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(Class1.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:187: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(instance1.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:189: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
args = inspect.formatargspec(*argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:203: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(Class2.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_classmethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:204: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(instance2.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:137: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
argspec = inspect.getargspec(_adapter)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:150: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(Class1.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:151: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(instance1.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:153: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
args = inspect.formatargspec(*argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:166: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(Class2.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_instancemethod
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:167: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(instance2.function), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_function
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:110: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
argspec = inspect.getargspec(_adapter)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_function
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:120: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(_function_1), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_function
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:122: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
args = inspect.formatargspec(*argspec)
tests/test_adapter.py::TestDynamicAdapter::test_dynamic_adapter_function
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:132: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
self.assertEqual(inspect.getargspec(_function_2), argspec)
tests/test_adapter.py::TestDynamicAdapter::test_adapter_factory
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:208: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
argspec = inspect.getargspec(wrapped)
tests/test_adapter.py::TestDynamicAdapter::test_adapter_factory
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_adapter.py:220: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
argspec = inspect.getargspec(_function_1)
tests/test_inner_classmethod.py::TestNamingInnerClassMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_classmethod.py:105: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original().function)
tests/test_inner_classmethod.py::TestNamingInnerClassMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_classmethod.py:106: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class().function)
tests/test_inner_classmethod.py::TestNamingInnerClassMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_classmethod.py:98: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original.function)
tests/test_inner_classmethod.py::TestNamingInnerClassMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_classmethod.py:99: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class.function)
tests/test_outer_staticmethod.py::TestNamingOuterStaticMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_staticmethod.py:105: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original().function)
tests/test_outer_staticmethod.py::TestNamingOuterStaticMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_staticmethod.py:106: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class().function)
tests/test_outer_staticmethod.py::TestNamingOuterStaticMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_staticmethod.py:98: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original.function)
tests/test_outer_staticmethod.py::TestNamingOuterStaticMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_staticmethod.py:99: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class.function)
tests/test_outer_classmethod.py::TestNamingOuterClassMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_classmethod.py:105: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original().function)
tests/test_outer_classmethod.py::TestNamingOuterClassMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_classmethod.py:106: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class().function)
tests/test_outer_classmethod.py::TestNamingOuterClassMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_classmethod.py:98: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original.function)
tests/test_outer_classmethod.py::TestNamingOuterClassMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_outer_classmethod.py:99: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class.function)
tests/test_inner_staticmethod.py::TestNamingInnerStaticMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_staticmethod.py:105: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original().function)
tests/test_inner_staticmethod.py::TestNamingInnerStaticMethod::test_instance_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_staticmethod.py:106: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class().function)
tests/test_inner_staticmethod.py::TestNamingInnerStaticMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_staticmethod.py:98: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
original_argspec = inspect.getargspec(Original.function)
tests/test_inner_staticmethod.py::TestNamingInnerStaticMethod::test_class_argspec
/home/tkloczko/rpmbuild/BUILD/wrapt-1.12.1/tests/test_inner_staticmethod.py:99: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
function_argspec = inspect.getargspec(Class.function)
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
FAILED tests/test_monkey_patching.py::TestMonkeyPatching::test_wrap_class_method_inherited - AssertionError: <class 'test_monkey_patching.Class_2_1'> != <class 'test_mon...
================================================================ 1 failed, 374 passed, 54 warnings in 8.89s ================================================================
Just a note to say I am aware of the deprecation warnings. Sort of been holding out until finally drop Python 2.7 support at which point would just switch them all to use inspect.getfullargspec(). For now at least they aren't going to be removing inspect.getargspec() from Python 3, so haven't been in a rush to add some extra logic to use one function when is Python 2.7 and a different function if 3.X.
As python 2.x has been EOSed +1.5 year ago I would suggest branch git repo for 2.x support and clean on master everything for latest python 3.x (IIRC in Sep will be released first 3.10)
I think this issue was dealt with at some point as can't see references to inspect.getargspec() in code anymore, so closing issue.