fix issue224 - invocations with >256 char arguments now work
This commit is contained in:
parent
d31f4dcba8
commit
c64c567b75
|
@ -1,6 +1,7 @@
|
||||||
Changes between 2.3.3 and 2.3.4.dev
|
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
|
- fix issue91 - add/discuss package/directory level setups in example
|
||||||
- allow to dynamically define markers via
|
- allow to dynamically define markers via
|
||||||
item.keywords[...]=assignment integrating with "-m" option
|
item.keywords[...]=assignment integrating with "-m" option
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#
|
#
|
||||||
__version__ = '2.3.4.dev3'
|
__version__ = '2.3.4.dev4'
|
||||||
|
|
|
@ -181,7 +181,7 @@ class Conftest(object):
|
||||||
if hasattr(arg, 'startswith') and arg.startswith("--"):
|
if hasattr(arg, 'startswith') and arg.startswith("--"):
|
||||||
continue
|
continue
|
||||||
anchor = current.join(arg, abs=1)
|
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)
|
self._try_load_conftest(anchor)
|
||||||
foundanchor = True
|
foundanchor = True
|
||||||
if not foundanchor:
|
if not foundanchor:
|
||||||
|
@ -479,6 +479,11 @@ class Config(object):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
py.test.skip("no %r value found" %(name,))
|
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):
|
def getcfg(args, inibasenames):
|
||||||
args = [x for x in args if not str(x).startswith("-")]
|
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 base in arg.parts(reverse=True):
|
||||||
for inibasename in inibasenames:
|
for inibasename in inibasenames:
|
||||||
p = base.join(inibasename)
|
p = base.join(inibasename)
|
||||||
if p.check():
|
if exists(p):
|
||||||
iniconfig = py.iniconfig.IniConfig(p)
|
iniconfig = py.iniconfig.IniConfig(p)
|
||||||
if 'pytest' in iniconfig.sections:
|
if 'pytest' in iniconfig.sections:
|
||||||
return iniconfig['pytest']
|
return iniconfig['pytest']
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -48,7 +48,7 @@ def main():
|
||||||
name='pytest',
|
name='pytest',
|
||||||
description='py.test: simple powerful testing with Python',
|
description='py.test: simple powerful testing with Python',
|
||||||
long_description = long_description,
|
long_description = long_description,
|
||||||
version='2.3.4.dev3',
|
version='2.3.4.dev4',
|
||||||
url='http://pytest.org',
|
url='http://pytest.org',
|
||||||
license='MIT license',
|
license='MIT license',
|
||||||
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
||||||
|
|
|
@ -315,3 +315,7 @@ def test_cmdline_processargs_simple(testdir):
|
||||||
"*-h*",
|
"*-h*",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
def test_toolongargs_issue224(testdir):
|
||||||
|
result = testdir.runpytest("-m", "hello" * 500)
|
||||||
|
assert result.ret == 0
|
||||||
|
|
Loading…
Reference in New Issue