diff --git a/CHANGELOG b/CHANGELOG index 5db3a6489..b2ea16258 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,11 @@ Changes between 2.0.0 and 2.0.1.dev1 ---------------------------------------------- -- fix issue9: direct setup/teardown functions for an xfail-marked - test will report as xfail if they fail (but reported as normal - passing setup/teardown). +- fix issue9: setup/teardown functions for an xfail-marked + test will report as xfail if they fail but report as normally + passing (not xpassing) if they succeed. This only is true + for "direct" setup/teardown invocations because teardown_class/ + teardown_module cannot closely relate to a single test. - fix issue8: no logging errors at process exit - refinements to "collecting" output on non-ttys - refine internal plugin registration and --traceconfig output diff --git a/_pytest/core.py b/_pytest/core.py index a8b5f9086..5c202e28d 100644 --- a/_pytest/core.py +++ b/_pytest/core.py @@ -119,11 +119,7 @@ class PluginManager(object): py.test.skip("plugin %r is missing" % name) def hasplugin(self, name): - try: - self.getplugin(name) - return True - except KeyError: - return False + return bool(self.getplugin(name)) def getplugin(self, name): if name is None: