py.test does not start (EBUSY: [Resource device])

血红的双手。 提交于 2019-11-28 04:53:43

问题


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',)

Here is the output:

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 =========================

What could that be?

Thanks


回答1:


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.

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



来源:https://stackoverflow.com/questions/11890398/py-test-does-not-start-ebusy-resource-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!