astropy: DeprecationWarning for inspect.getargspec() raises Error/Fail in pytest-3.6
Running the tests for 2.0rc1 I am seeing 24 failures reported, all apparently based on the same
warnings.warn("inspect.getargspec() is deprecated, "
"use inspect.signature() or inspect.getfullargspec()",
> DeprecationWarning, stacklevel=2)
E DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
../../../../../inspect.py:1041: DeprecationWarning
Setup:
platform darwin -- Python 3.6.1, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
Running tests with Astropy version 2.0rc1.
Running tests in /sw/lib/python3.6/site-packages/astropy.
Date: 2017-06-29T01:55:41
Platform: Darwin-16.6.0-x86_64-i386-64bit
Executable: /sw/bin/python3.6
Full Python Version:
3.6.1 (default, May 3 2017, 21:41:23)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.12.1
Scipy: 0.19.1
Matplotlib: 2.0.2
h5py: 2.7.0
Pandas: 0.20.2
Cython: 0.25.2
Using Astropy options: remote_data: none.
rootdir: /sw/lib/python3.6/site-packages/astropy, inifile:
plugins: hypothesis-3.6.1, backports.unittest-mock-1.2.1
with beautifulsoup 4.6.0
.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (15 by maintainers)
Just found it, too - yes, just requires a copy of @mdboom’s fix for the 3.5 version.
Whatever is easier - this is my patch:
Oh, good that you say that, I haven’t noticed. The base for every PR should be master, we’ll do the backporting separately. However I can change the base on your PR.
Hmm, looks like it has something to do with the
warnings.filters
setting, because confusingly I saw neither an exception nor a warning when tryingdirectly from the
python3.6
interpreter. These are the filter settings when starting a new Python 3.6 sessions:and after running the
io.ascii
tests (with the failures):Exactly the same in 3.5, except the tests do not fail…
Ah, I think now I see why - at some point in the tests the general
DeprecationWarning
filter is replaced by four filters for specific warnings, and all other are turned into('error', re.compile('.*', re.IGNORECASE), <class 'DeprecationWarning'>, re.compile(''), 0)
But since theinspect
warning between 3.5 and 3.6 was changed from"use inspect.signature() instead"
to"use inspect.signature() or inspect.getfullargspec()"
, the filter fails in the latter.Any ideas if this is part of the
astropy
-specificpytest
setup, or where to change it?