Skip to content

fix readme example being inverted #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
```

Expand All @@ -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.

Expand Down