From 2b762337bdf6d1f6152d33108600a29cef07d3a4 Mon Sep 17 00:00:00 2001 From: Harry Percival Date: Tue, 25 Sep 2018 06:49:50 +0100 Subject: [PATCH] add documentation of register_assert_rewrite wip --- doc/en/assert.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/en/assert.rst b/doc/en/assert.rst index e0e9b9305..76cd66e41 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -264,8 +264,12 @@ Advanced assertion introspection Reporting details about a failing assertion is achieved by rewriting assert statements before they are run. Rewritten assert statements put introspection information into the assertion failure message. ``pytest`` only rewrites test -modules directly discovered by its test collection process, so asserts in -supporting modules which are not themselves test modules will not be rewritten. +modules directly discovered by its test collection process, so **asserts in +supporting modules which are not themselves test modules will not be rewritten**. + +You can manually enable assertion rewriting for an imported module by calling +`register_assert_rewrite` +before you import it. .. note::