13
13
# for plugin test we try to automatically make sure that
14
# the according plugin is loaded
14
# the according plugin is loaded
15
15
def pytest_funcarg__testdir(request):
16
16
testdir = request.getfuncargvalue("testdir")
17
17
#for obj in (request.cls, request.module):
18
# if hasattr(obj, 'testplugin'):
18
# if hasattr(obj, 'testplugin'):
19
19
# testdir.plugins.append(obj.testplugin)
22
modname = request.module.__name__.split(".")[-1]
22
modname = request.module.__name__.split(".")[-1]
23
23
if modname.startswith("test_pytest_"):
24
24
modname = modname[5:]
25
25
if plugindir.join("%s.py" % modname).check():
26
26
if modname[7:] not in default_plugins:
27
27
testdir.plugins.append(vars(request.module))
28
testdir.plugins.append(modname)
28
testdir.plugins.append(modname)
29
29
#elif modname.startswith("test_pytest"):
30
30
# pname = modname[5:]
31
31
# assert pname not in testdir.plugins
32
# testdir.plugins.append(pname)
32
# testdir.plugins.append(pname)
33
33
# #testdir.plugins.append(vars(request.module))
35
35
pass # raise ValueError("need better support code")