2 new changesets in pytest: http://bitbucket.org/hpk42/pytest/changeset/68e8157654ab/ changeset: 68e8157654ab user: gutworth date: 2011-06-18 22:07:36 summary: note condition for introspection happening affected #: 1 file (106 bytes)
--- a/doc/assert.txt Mon Jun 13 08:50:50 2011 -0500 +++ b/doc/assert.txt Sat Jun 18 15:07:36 2011 -0500 @@ -44,6 +44,9 @@ allows you to use the idiomatic python constructs without boilerplate code while not losing introspection information. +Assertion introspection is enabled only when a message is not manually provided +in the assert statement. + See :ref:`assert-details` for more information on assertion introspection. http://bitbucket.org/hpk42/pytest/changeset/2216dc60b2a6/ changeset: 2216dc60b2a6 user: gutworth date: 2011-06-18 22:09:50 summary: merge heads affected #: 2 files (502 bytes) --- a/doc/assert.txt Sat Jun 18 15:07:36 2011 -0500 +++ b/doc/assert.txt Sat Jun 18 15:09:50 2011 -0500 @@ -132,9 +132,12 @@ .. _assert-details: +.. _`assert introspection`: -Assertion introspection details -------------------------------- +Advanced assertion introspection +---------------------------------- + +.. versionadded:: 2.1 Reporting details about the failing assertion is achieved either by rewriting assert statements before they are run or re-evaluating the assert expression and --- a/doc/getting-started.txt Sat Jun 18 15:07:36 2011 -0500 +++ b/doc/getting-started.txt Sat Jun 18 15:09:50 2011 -0500 @@ -61,20 +61,10 @@ .. note:: - You can simply use the ``assert`` statement for asserting - expectations because intermediate values will be presented to you. - This is arguably easier than learning all the `the JUnit legacy - methods`_. - - However, there remains one caveat to using simple asserts: your - assertion expression should better be side-effect free. Because - after an assertion failed py.test will re-evaluate the expression - in order to present intermediate values. You will get a nice warning - and you can easily fix it: compute the value ahead of the assert and - then do the assertion. Or maybe just use the assert "explicit message" - syntax:: - - assert expr, "message" # show "message" if expr is not True + You can simply use the ``assert`` statement for asserting test + expectations. pytest's :ref:`assert introspection` will intelligently + report intermediate values of the assert expression freeing + you from the need to learn the many names of `JUnit legacy methods`_. .. _`the JUnit legacy methods`: http://docs.python.org/library/unittest.html#test-cases 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