Workaround for cmdexec bug on Windows
This bug fails the entire pytest suite when executed with the --lsof option in Python 2 on Windows.
This commit is contained in:
parent
9f94e443ff
commit
033def0a7a
|
@ -74,7 +74,10 @@ class LsofFdLeakChecker(object):
|
|||
def matching_platform(self):
|
||||
try:
|
||||
py.process.cmdexec("lsof -v")
|
||||
except py.process.cmdexec.Error:
|
||||
except (py.process.cmdexec.Error, UnicodeDecodeError):
|
||||
# cmdexec may raise UnicodeDecodeError on Windows systems
|
||||
# with locale other than english:
|
||||
# https://bitbucket.org/pytest-dev/py/issues/66
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
|
|
@ -650,7 +650,7 @@ def lsof_check():
|
|||
try:
|
||||
out = py.process.cmdexec("lsof -p %d" % pid)
|
||||
except (py.process.cmdexec.Error, UnicodeDecodeError):
|
||||
# about UnicodeDecodeError, see note on conftest.py
|
||||
# about UnicodeDecodeError, see note on pytester
|
||||
pytest.skip("could not run 'lsof'")
|
||||
yield
|
||||
out2 = py.process.cmdexec("lsof -p %d" % pid)
|
||||
|
|
Loading…
Reference in New Issue