From 5e479c94ceda041e9b6467fd9628291900a1b1f0 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 21 Mar 2013 12:19:01 -0500 Subject: [PATCH] disable assertion rewriting on CPython 2.6.0 because of bugs (fixes #280) --- CHANGELOG | 2 ++ _pytest/assertion/__init__.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 647ee5372..52ebc80ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- +- issue 280 - disable assertion rewriting on buggy CPython 2.6.0 + - inject "getfixture()" helper to retrieve fixtures from doctests, thanks Andreas Zeidler diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py index b7ec1924d..bd3b594fd 100644 --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -39,7 +39,10 @@ def pytest_configure(config): except ImportError: mode = "reinterp" else: - if sys.platform.startswith('java'): + # Both Jython and CPython 2.6.0 have AST bugs that make the + # assertion rewriting hook malfunction. + if (sys.platform.startswith('java') or + sys.version_info[:3] == (2, 6, 0)): mode = "reinterp" if mode != "plain": _load_modules(mode)