py.test 不启动(EBUSY:[资源设备]) [英] py.test does not start (EBUSY: [Resource device])

查看:46
本文介绍了py.test 不启动(EBUSY:[资源设备])的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Just installed py.test with pip install -U pytest with no errors, however we I'm trying to launch py.test I get error: EBUSY: [Resource device]: 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 被调用时,它开始使用 标准测试发现规则.并且某些文件夹具有访问权限限制访问,因此出现此错误.

Apparently, when py.test is called it starts looking through the files/folders using standard test discovery rules. And some folders have access permissions that limit the access, thus this error occurs.

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

to use py.test one must first navigate to the folder with test cases.

这篇关于py.test 不启动(EBUSY:[资源设备])的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆