make initial conftest finding ignore "--" arguments
--HG-- branch : trunk
This commit is contained in:
parent
6fa58fd8c9
commit
f554fa03ae
|
@ -55,6 +55,7 @@ Bug fixes / Maintenance
|
||||||
get canonical script paths in virtualenv situations
|
get canonical script paths in virtualenv situations
|
||||||
- make path.bestrelpath(path) return ".", note that when calling
|
- make path.bestrelpath(path) return ".", note that when calling
|
||||||
X.bestrelpath the assumption is that X is a directory.
|
X.bestrelpath the assumption is that X is a directory.
|
||||||
|
- make initial conftest discovery ignore "--" prefixed arguments
|
||||||
|
|
||||||
Changes between 1.3.0 and 1.3.1
|
Changes between 1.3.0 and 1.3.1
|
||||||
==================================================
|
==================================================
|
||||||
|
|
|
@ -36,6 +36,8 @@ class Conftest(object):
|
||||||
self._confcutdir = p
|
self._confcutdir = p
|
||||||
break
|
break
|
||||||
for arg in args + [current]:
|
for arg in args + [current]:
|
||||||
|
if hasattr(arg, 'startswith') and arg.startswith("--"):
|
||||||
|
continue
|
||||||
anchor = current.join(arg, abs=1)
|
anchor = current.join(arg, abs=1)
|
||||||
if anchor.check(): # we found some file object
|
if anchor.check(): # we found some file object
|
||||||
self._path2confmods[None] = self.getconftestmodules(anchor)
|
self._path2confmods[None] = self.getconftestmodules(anchor)
|
||||||
|
|
|
@ -98,6 +98,14 @@ def test_conftest_in_nonpkg_with_init(tmpdir):
|
||||||
tmpdir.ensure("adir-1.0/__init__.py")
|
tmpdir.ensure("adir-1.0/__init__.py")
|
||||||
conftest = ConftestWithSetinitial(tmpdir.join("adir-1.0", "b"))
|
conftest = ConftestWithSetinitial(tmpdir.join("adir-1.0", "b"))
|
||||||
|
|
||||||
|
def test_doubledash_not_considered(testdir):
|
||||||
|
conf = testdir.mkdir("--option")
|
||||||
|
conf.join("conftest.py").ensure()
|
||||||
|
conftest = Conftest()
|
||||||
|
conftest.setinitial([conf.basename, conf.basename])
|
||||||
|
l = conftest.getconftestmodules(None)
|
||||||
|
assert len(l) == 0
|
||||||
|
|
||||||
def test_conftestcutdir(testdir):
|
def test_conftestcutdir(testdir):
|
||||||
conf = testdir.makeconftest("")
|
conf = testdir.makeconftest("")
|
||||||
p = testdir.mkdir("x")
|
p = testdir.mkdir("x")
|
||||||
|
|
Loading…
Reference in New Issue