1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/changeset/6cd04a7beadb/ changeset: 6cd04a7beadb user: hpk42 date: 2011-12-28 17:47:08 summary: fix unittest/marker integration affected #: 4 files diff -r d2ba1109c1530ae74036e08b68bc18d50e16397f -r 6cd04a7beadb4df14cf57e8f0f601cfd15613d5e _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.2.dev4' +__version__ = '2.2.2.dev5' diff -r d2ba1109c1530ae74036e08b68bc18d50e16397f -r 6cd04a7beadb4df14cf57e8f0f601cfd15613d5e _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -221,9 +221,9 @@ module = self.getparent(Module).obj clscol = self.getparent(Class) cls = clscol and clscol.obj or None + transfer_markers(funcobj, cls, module) metafunc = Metafunc(funcobj, config=self.config, cls=cls, module=module) - transfer_markers(metafunc) gentesthook = self.config.hook.pytest_generate_tests extra = [module] if cls is not None: @@ -241,20 +241,19 @@ l.append(function) return l -def transfer_markers(metafunc): +def transfer_markers(funcobj, cls, mod): # XXX this should rather be code in the mark plugin or the mark # plugin should merge with the python plugin. - for holder in (metafunc.cls, metafunc.module): + for holder in (cls, mod): try: pytestmark = holder.pytestmark except AttributeError: continue if isinstance(pytestmark, list): for mark in pytestmark: - mark(metafunc.function) + mark(funcobj) else: - pytestmark(metafunc.function) - + pytestmark(funcobj) class Module(pytest.File, PyCollectorMixin): def _getobj(self): diff -r d2ba1109c1530ae74036e08b68bc18d50e16397f -r 6cd04a7beadb4df14cf57e8f0f601cfd15613d5e _pytest/unittest.py --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -2,6 +2,9 @@ import pytest, py import sys, pdb +# for transfering markers +from _pytest.python import transfer_markers + def pytest_pycollect_makeitem(collector, name, obj): unittest = sys.modules.get('unittest') if unittest is None: @@ -19,7 +22,12 @@ class UnitTestCase(pytest.Class): def collect(self): loader = py.std.unittest.TestLoader() + module = self.getparent(pytest.Module).obj + cls = self.obj for name in loader.getTestCaseNames(self.obj): + x = getattr(self.obj, name) + funcobj = getattr(x, 'im_func', x) + transfer_markers(funcobj, cls, module) yield TestCaseFunction(name, parent=self) def setup(self): diff -r d2ba1109c1530ae74036e08b68bc18d50e16397f -r 6cd04a7beadb4df14cf57e8f0f601cfd15613d5e setup.py --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.2.dev4', + version='2.2.2.dev5', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ py-svn mailing list py-svn@codespeak.net http://codespeak.net/mailman/listinfo/py-svn