introduce --confcutdir option to early-inhibit lookup of conftest files above a certain directory.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-12-31 15:10:32 +01:00
parent eb4249322e
commit 2752168a58
5 changed files with 90 additions and 9 deletions
+11
View File
@@ -92,3 +92,14 @@ def test_pytest_report_iteminfo():
res = pytest_report_iteminfo(FakeItem())
assert res == "-reportinfo-"
def test_conftest_confcutdir(testdir):
testdir.makeconftest("assert 0")
x = testdir.mkdir("x")
x.join("conftest.py").write(py.code.Source("""
def pytest_addoption(parser):
parser.addoption("--xyz", action="store_true")
"""))
result = testdir.runpytest("-h", "--confcutdir=%s" % x, x)
assert result.stdout.fnmatch_lines(["*--xyz*"])