diff --git a/changelog/12153.doc.rst b/changelog/12153.doc.rst index 2363017f5..ac36becf9 100644 --- a/changelog/12153.doc.rst +++ b/changelog/12153.doc.rst @@ -1 +1 @@ -Updated docs: Documented new way to detect if a code is running from within a pytest run +Documented using :envvar:`PYTEST_VERSION` to detect if code is running from within a pytest run. diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index b5561eee2..dec1bed5f 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -413,10 +413,10 @@ running from a test you can do this: if os.environ.get("PYTEST_VERSION") is not None: - # things you want to to do if your code is called by pytest + # Things you want to to do if your code is called by pytest. ... else: - # things you want to to do if your code is not called by pytest + # Things you want to to do if your code is not called by pytest. ...