1
我有一套的Python 3单元测试中,当被使用此命令行执行:我怎样才能找出哪一行Python代码产生PendingDeprecationWarning?
python3 -m unittest discover -f -v
...正在生成PendingDeprecationWarning:
/usr/local/Cellar/python3/3.4.2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imp.py:32:
PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
有没有一种简单的方法我跟踪哪个代码最终使用imp.py
,也许通过打开某种形式的堆栈跟踪?我已经缩小了一点;它似乎只在我使用freezegun时触发。然而,freezegun本身似乎并没有使用imp。
完美!这帮助我确定它是依赖的图书馆“六”。 –
FWIW,这是错误:https://bitbucket.org/gutworth/six/issue/112/sixmovesreload_module-uses-deprecated-imp –