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
Alex Okrushko
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