Skip to content

Commit 0edba2d

Browse files
committed
emit_warning: improve docstring
1 parent af4f91d commit 0edba2d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

unpythonic/test/fixtures.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,15 @@ def _reset(counter):
187187
def emit_warning(msg):
188188
"""Emit a test warning from infrastructure code (outside a ``test[]`` expression).
189189
190-
Use this in test runners and other infrastructure that needs to signal
191-
a warning through the test framework without being inside a ``test[]``
190+
If you are writing tests, use the `warn[]` macro instead.
191+
192+
Use this function in test runners and other infrastructure that needs to
193+
signal a warning through the test framework without being inside a ``test[]``
192194
or ``warn[]`` macro. The warning will be displayed and counted by the
193195
nearest enclosing ``testset``.
194-
195-
Unlike the ``warn[]`` macro, this does not adjust ``tests_run``,
196-
because no test has been counted for this warning to "replace".
197196
"""
197+
# Unlike the ``warn[]`` macro, this does not adjust ``tests_run``,
198+
# because no test has been counted for this warning to "replace".
198199
_update(tests_warned, +1)
199200
cerror(TestWarning(msg))
200201

0 commit comments

Comments
 (0)