diff --git a/CHANGELOG b/CHANGELOG index bcb0ac7d1..07024fd5b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +Changes between 2.1.0 and 2.1.1.DEV +---------------------------------------------- + +- XXX + Changes between 2.0.3 and 2.1.0.DEV ---------------------------------------------- diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 05d547c21..c6fa1adc5 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.1.0' +__version__ = '2.1.1.dev1' diff --git a/_pytest/assertion/newinterpret.py b/_pytest/assertion/newinterpret.py index 2696abda7..de03eaf8b 100644 --- a/_pytest/assertion/newinterpret.py +++ b/_pytest/assertion/newinterpret.py @@ -53,7 +53,7 @@ def interpret(source, frame, should_fail=False): if should_fail: return ("(assertion failed, but when it was re-run for " "printing intermediate values, it did not fail. Suggestions: " - "compute assert expression before the assert or use --no-assert)") + "compute assert expression before the assert or use --assert=plain)") def run(offending_line, frame=None): if frame is None: diff --git a/_pytest/assertion/oldinterpret.py b/_pytest/assertion/oldinterpret.py index e10987141..3ca12ec2b 100644 --- a/_pytest/assertion/oldinterpret.py +++ b/_pytest/assertion/oldinterpret.py @@ -482,7 +482,7 @@ def interpret(source, frame, should_fail=False): if should_fail: return ("(assertion failed, but when it was re-run for " "printing intermediate values, it did not fail. Suggestions: " - "compute assert expression before the assert or use --nomagic)") + "compute assert expression before the assert or use --assert=plain)") else: return None diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index 751f73a1e..a6eb832f5 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -421,7 +421,7 @@ class AssertionRewriter(ast.NodeVisitor): if chain: where = [] if len(chain) > 1: - cond = ast.Boolop(ast.And(), chain) + cond = ast.BoolOp(ast.And(), list(chain)) else: cond = chain[0] self.statements.append(ast.If(cond, where, [])) diff --git a/doc/assert.txt b/doc/assert.txt index 9c53d3bee..827bfac85 100644 --- a/doc/assert.txt +++ b/doc/assert.txt @@ -240,6 +240,8 @@ easy to rewrite the assertion and avoid any trouble:: All assert introspection can be turned off by passing ``--assert=plain``. +For further information, Benjamin Peterson wrote up `Behind the scenes of py.test's new assertion rewriting `_. + .. versionadded:: 2.1 Add assert rewriting as an alternate introspection technique. diff --git a/doc/talks.txt b/doc/talks.txt index 293a28489..33e791fa3 100644 --- a/doc/talks.txt +++ b/doc/talks.txt @@ -28,6 +28,11 @@ test parametrization: - `parametrizing tests, generalized`_ (blog post) - `putting test-hooks into local or global plugins`_ (blog post) +assertion introspection + +- `(07/2011) Behind the scenes of py.test's new assertion rewriting + `_ + distributed testing: - `simultaneously test your code on all platforms`_ (blog entry) diff --git a/setup.py b/setup.py index 6aad48ff2..1a2e3e6f2 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.1.0', + version='2.1.1.dev1', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], @@ -70,4 +70,4 @@ def make_entry_points(): return {'console_scripts': l} if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 62a256db5..918b550b8 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -137,6 +137,10 @@ class TestAssertionRewrite: g = False assert f or g getmsg(f, must_pass=True) + def f(): + f = g = h = lambda: True + assert f() and g() and h() + getmsg(f, must_pass=True) def test_short_circut_evaluation(self): def f():