Skip to content

Commit

Permalink
doc: update information about assertion messages (#11285)
Browse files Browse the repository at this point in the history
It was pointed out[0] that the previous behaviour has been obsoleted by
commit 37bd1e0.

[0] #11265 (comment)

Signed-off-by: Christoph Anton Mitterer <[email protected]>
  • Loading branch information
calestyo authored Aug 5, 2023
1 parent b8b7433 commit cc0adf6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/en/how-to/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ operators. (See :ref:`tbreportdemo`). This allows you to use the
idiomatic python constructs without boilerplate code while not losing
introspection information.

However, if you specify a message with the assertion like this:
If a message is specified with the assertion like this:

.. code-block:: python
assert a % 2 == 0, "value was odd, should be even"
then no assertion introspection takes places at all and the message
will be simply shown in the traceback.
it is printed alongside the assertion introspection in the traceback.

See :ref:`assert-details` for more information on assertion introspection.

Expand Down

0 comments on commit cc0adf6

Please sign in to comment.