File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -264,8 +264,12 @@ Advanced assertion introspection
264
264
Reporting details about a failing assertion is achieved by rewriting assert
265
265
statements before they are run. Rewritten assert statements put introspection
266
266
information into the assertion failure message. ``pytest `` only rewrites test
267
- modules directly discovered by its test collection process, so asserts in
268
- supporting modules which are not themselves test modules will not be rewritten.
267
+ modules directly discovered by its test collection process, so **asserts in
268
+ supporting modules which are not themselves test modules will not be rewritten **.
269
+
270
+ You can manually enable assertion rewriting for an imported module by calling
271
+ `register_assert_rewrite <https://docs.pytest.org/en/latest/writing_plugins.html#assertion-rewriting >`_
272
+ before you import it (a good place to do that is in ``conftest.py ``).
269
273
270
274
.. note ::
271
275
You can’t perform that action at this time.
0 commit comments