summaryrefslogtreecommitdiff
path: root/testing/test_conftest.py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2012-06-26 21:56:03 +0200
committerholger krekel <holger@merlinux.eu>2012-06-26 21:56:03 +0200
commitecec653e98158a6eb32b9c303527d5de169850eb (patch)
tree2d0f0f9418eb01a12a8a91e16573fbd0839fe8c5 /testing/test_conftest.py
parent0ba0f917204e33546a4ae6a64c968765d8b5f86f (diff)
downloadpytest-ecec653e98158a6eb32b9c303527d5de169850eb.tar.gz
fix issue151 - heuristcally lookup conftest files on all command line arguments, not just the first existing dir/file
you can install the corresponding pytest-2.3.dev2 via pip install -i http:/pypi.testrun.org -U pytest
Diffstat (limited to 'testing/test_conftest.py')
-rw-r--r--testing/test_conftest.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/testing/test_conftest.py b/testing/test_conftest.py
index 1a2bdfe77..d4ec62bb8 100644
--- a/testing/test_conftest.py
+++ b/testing/test_conftest.py
@@ -15,7 +15,8 @@ def pytest_funcarg__basedir(request):
d.ensure("adir/__init__.py")
d.ensure("adir/b/__init__.py")
return d
- return request.cached_setup(lambda: basedirmaker(request), extrakey=request.param)
+ return request.cached_setup(
+ lambda: basedirmaker(request), extrakey=request.param)
def ConftestWithSetinitial(path):
conftest = Conftest()
@@ -106,6 +107,17 @@ def test_doubledash_not_considered(testdir):
l = conftest.getconftestmodules(None)
assert len(l) == 0
+def test_issue151_load_all_conftests(testdir):
+ names = "code proj src".split()
+ for name in names:
+ p = testdir.mkdir(name)
+ p.ensure("conftest.py")
+
+ conftest = Conftest()
+ conftest.setinitial(names)
+ d = list(conftest._conftestpath2mod.values())
+ assert len(d) == len(names)
+
def test_conftest_global_import(testdir):
testdir.makeconftest("x=3")
p = testdir.makepyfile("""