From e8fd3fe03ef644815966d299c4e5d861fc3bc924 Mon Sep 17 00:00:00 2001 From: jakkdl Date: Mon, 3 Mar 2025 16:30:29 +0100 Subject: [PATCH] fix readme example being inverted --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0748fb3..9f0bed9 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,13 @@ Adapt rules to suit your needs! Imagine that we have this code: ```python -try: # pragma: has-django +try: # pragma: has-no-django import django -except ImportError: # pragma: has-no-django +except ImportError: # pragma: has-django django = None def run_if_django_is_installed(): - if django is not None: # pragma: has-django + if django is not None: # pragma: has-no-django ... ``` @@ -96,6 +96,9 @@ rules = ``` +Important to consider here is that the condition evaluating to `True` +means that the coverage will be ignored. + When running tests with and without `django` installed you will have `100%` coverage in both cases.