Problem
当执行 py.test
时,报错:
File "/usr/local/lib/python3.7/site-packages/_pytest/tmpdir.py", line 35, in TempPathFactory
lambda p: Path(os.path.abspath(six.text_type(p)))
TypeError: attrib() got an unexpected keyword argument 'convert'
Solution
查看 py.test 版本:
$ py.test --version
This is pytest version 4.0.2, imported from /Working/backend/venv/lib/python2.7/site-packages/pytest.pyc
setuptools registered plugins:
pytest-mock-1.11.2 at /Working/backend/venv/lib/python2.7/site-packages/pytest_mock/__init__.pyc
pytest-cov-2.8.1 at /Working/backend/venv/lib/python2.7/site-packages/pytest_cov/plugin.py
pip list
查看当前安装的 attrs
版本,pytest
依赖于 attrs
。
attrs==19.2.0
引入了上面的错误,因此将 attrs 切回到 19.1.0版本:
$ pip install attrs==19.1.0
Reference
FEATURED TAGS
algorithm
algorithmproblem
architecturalpattern
architecture
aws
c#
cachesystem
codis
compile
concurrentcontrol
database
dataformat
datastructure
debug
design
designpattern
distributedsystem
django
docker
domain
engineering
freebsd
git
golang
grafana
hackintosh
hadoop
hardware
hexo
http
hugo
ios
iot
java
javaee
javascript
kafka
kubernetes
linux
linuxcommand
linuxio
lock
macos
markdown
microservices
mysql
nas
network
networkprogramming
nginx
node.js
npm
oop
openwrt
operatingsystem
padavan
performance
programming
prometheus
protobuf
python
redis
router
security
shell
software testing
spring
sql
systemdesign
truenas
ubuntu
vmware
vpn
windows
wmware
wordpress
xml
zookeeper