Skip to content

Commit c5fdc62

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4d8043f commit c5fdc62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/en/example/simple.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -423,19 +423,20 @@ This is a simple way to do it:
423423
# called "normally"
424424
...
425425
426-
This works great, but you should be aware that there is an issue with it. If there is a pytest import anywhere
426+
This works great, but you should be aware that there is an issue with it. If there is a pytest import anywhere
427427
in your code flow, ``"pytest" in sys.modules`` will return True even if your code is not actually running from within a pytest run.
428428

429429
.. code-block:: python
430430
431431
import sys
432432
433-
import pytest # unused anywhere in your code
433+
import pytest # unused anywhere in your code
434434
435435
436436
def is_called_from_test_by_pytest():
437437
return "pytest" in sys.modules
438438
439+
439440
# is_called_from_test_by_pytest() will return True even if your code is not actually running from within a pytest run
440441
# as there is a pytest import in your code flow
441442

0 commit comments

Comments
 (0)