fix issue224 - invocations with >256 char arguments now work

This commit is contained in:
holger krekel 2012-11-12 10:15:43 +01:00
parent d31f4dcba8
commit c64c567b75
5 changed files with 14 additions and 4 deletions

View File

@ -1,6 +1,7 @@
Changes between 2.3.3 and 2.3.4.dev
-----------------------------------
- fix issue224 - invocations with >256 char arguments now work
- fix issue91 - add/discuss package/directory level setups in example
- allow to dynamically define markers via
item.keywords[...]=assignment integrating with "-m" option

View File

@ -1,2 +1,2 @@
#
__version__ = '2.3.4.dev3'
__version__ = '2.3.4.dev4'

View File

@ -181,7 +181,7 @@ class Conftest(object):
if hasattr(arg, 'startswith') and arg.startswith("--"):
continue
anchor = current.join(arg, abs=1)
if anchor.check(): # we found some file object
if exists(anchor): # we found some file object
self._try_load_conftest(anchor)
foundanchor = True
if not foundanchor:
@ -479,6 +479,11 @@ class Config(object):
except KeyError:
py.test.skip("no %r value found" %(name,))
def exists(path, ignore=EnvironmentError):
try:
return path.check()
except ignore:
return False
def getcfg(args, inibasenames):
args = [x for x in args if not str(x).startswith("-")]
@ -489,7 +494,7 @@ def getcfg(args, inibasenames):
for base in arg.parts(reverse=True):
for inibasename in inibasenames:
p = base.join(inibasename)
if p.check():
if exists(p):
iniconfig = py.iniconfig.IniConfig(p)
if 'pytest' in iniconfig.sections:
return iniconfig['pytest']

View File

@ -48,7 +48,7 @@ def main():
name='pytest',
description='py.test: simple powerful testing with Python',
long_description = long_description,
version='2.3.4.dev3',
version='2.3.4.dev4',
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],

View File

@ -315,3 +315,7 @@ def test_cmdline_processargs_simple(testdir):
"*-h*",
])
def test_toolongargs_issue224(testdir):
result = testdir.runpytest("-m", "hello" * 500)
assert result.ret == 0