gpt4 book ai didi

python - py.test 未启动(EBUSY : [Resource device])

转载 作者:太空狗 更新时间:2023-10-30 03:05:30 26 4
gpt4 key购买 nike

刚刚使用 pip install -U pytest 安装了 py.test 没有错误,但是我们在尝试启动 py.test 时出现错误: EBUSY: [资源设备]: listdir('C:\\Users\\Administrator\\AppData\\Local\\Application Data',)

这是输出:

C:\Users\Administrator>py.test  
========================== test session starts ===========================
platform win32 -- Python 2.7.3 -- pytest-2.2.4
collected 0 items / 1 errors

================================= ERRORS =================================
___________________________ ERROR collecting . ___________________________
C:\Python27\lib\site-packages\py\_path\common.py:315: in visit
> for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
C:\Python27\lib\site-packages\py\_path\common.py:361: in gen
> for p in self.gen(subdir):
C:\Python27\lib\site-packages\py\_path\common.py:361: in gen
> for p in self.gen(subdir):
C:\Python27\lib\site-packages\py\_path\common.py:361: in gen
> for p in self.gen(subdir):
C:\Python27\lib\site-packages\py\_path\common.py:346: in gen
> entries = path.listdir()
C:\Python27\lib\site-packages\py\_path\local.py:320: in listdir
> for name in py.error.checked_call(os.listdir, self.strpath):
C:\Python27\lib\site-packages\py\_error.py:83: in checked_call
> raise cls("%s%r" % (func.__name__, args))
E EBUSY: [Resource device]: listdir('C:\\Users\\Administrator\\Ap
pData\\Local\\Application Data',)
======================== 1 error in 0.03 seconds =========================

那会是什么?

谢谢

最佳答案

显然,当 py.test 被调用时,它开始使用 standard test discovery rules 查看文件/文件夹。 .而有些文件夹的访问权限限制了访问,所以会出现这个错误。

要使用 py.test,必须首先导航到包含测试用例的文件夹。

关于python - py.test 未启动(EBUSY : [Resource device]),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11890398/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com