* add pytest_nose plugin

* have unittest functions always receive a fresh instance

--HG--
branch : 1.0.x
This commit is contained in:
holger krekel
2009-08-10 11:27:13 +02:00
parent a01e4769cc
commit b552f6eb46
9 changed files with 286 additions and 15 deletions

View File

@@ -15,10 +15,15 @@ def pytest_funcarg__testdir(request):
# testdir.plugins.append(obj.testplugin)
# break
#else:
basename = request.module.__name__.split(".")[-1]
if basename.startswith("pytest_"):
modname = request.module.__name__.split(".")[-1]
if modname.startswith("pytest_"):
testdir.plugins.append(vars(request.module))
testdir.plugins.append(basename)
testdir.plugins.append(modname)
#elif modname.startswith("test_pytest"):
# pname = modname[5:]
# assert pname not in testdir.plugins
# testdir.plugins.append(pname)
# #testdir.plugins.append(vars(request.module))
else:
pass # raise ValueError("need better support code")
return testdir