diff --git a/_py/test/plugin/pytest_hooklog.py b/_py/test/plugin/pytest_hooklog.py index 52e04d8b2..777ac9482 100644 --- a/_py/test/plugin/pytest_hooklog.py +++ b/_py/test/plugin/pytest_hooklog.py @@ -29,3 +29,5 @@ def pytest_unconfigure(config): del config.hook.__dict__['_performcall'] except KeyError: pass + else: + config._hooklogfile.close() diff --git a/_py/test/plugin/pytest_mark.py b/_py/test/plugin/pytest_mark.py index 1f64eb009..0aca94758 100644 --- a/_py/test/plugin/pytest_mark.py +++ b/_py/test/plugin/pytest_mark.py @@ -129,7 +129,9 @@ def pytest_pycollect_makeitem(__multicall__, collector, name, obj): if isinstance(item, py.test.collect.Function): cls = collector.getparent(py.test.collect.Class) mod = collector.getparent(py.test.collect.Module) - func = getattr(item.obj, 'im_func', item.obj) + func = item.obj + func = getattr(func, '__func__', func) # py3 + func = getattr(func, 'im_func', func) # py2 for parent in [x for x in (mod, cls) if x]: marker = getattr(parent.obj, 'pytestmark', None) if isinstance(marker, MarkerDecorator): diff --git a/_py/test/plugin/pytest_terminal.py b/_py/test/plugin/pytest_terminal.py index 3ca0bb4d2..3b9f243eb 100644 --- a/_py/test/plugin/pytest_terminal.py +++ b/_py/test/plugin/pytest_terminal.py @@ -272,7 +272,7 @@ class TerminalReporter: items = self.config.pluginmanager._name2plugin.items() for name, plugin in items: repr_plugin = repr(plugin) - fullwidth = getattr(self._tw, 'fullwidth', sys.maxint) + fullwidth = getattr(self._tw, 'fullwidth', 65000) if len(repr_plugin)+26 > fullwidth: repr_plugin = repr_plugin[:(fullwidth-30)] + '...' self.write_line(" %-20s: %s" %(name, repr_plugin))