diff --git a/docs/usage.md b/docs/usage.md index 0388a2b..3efce3e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -113,14 +113,17 @@ To manually add `debug` to `__builtins__`, add the following to `sitecustomize.p which is always imported. ```py -# add devtools `debug` function to builtins -import builtins -try: - from devtools import debug -except ImportError: - pass -else: - setattr(builtins, 'debug', debug) +import sys +# we don't install here for pytest as it breaks pytest, it is +# installed later by a pytest fixture +if not sys.argv[0].endswith('pytest'): + import builtins + try: + from devtools import debug + except ImportError: + pass + else: + setattr(builtins, 'debug', debug) ``` The `ImportError` exception is important since you'll want python to run fine even if *devtools* isn't installed.