Skip to content

Conversation

@adnathanail
Copy link
Contributor

No description provided.

Copy link

@sparrowt sparrowt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting this in the readme would have saved me a lot of time 👍 A couple of thoughts


.. code-block:: python
DEBUG = True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my local testing this top-level Django DEBUG setting isn't required, only the template debug setting below is needed so TEMPLATES ... 'OPTIONS': { 'debug': True } does seem to work even with DEBUG=False.

Given it is preferable to run tests in an as-close-to-prod-as-possible configuration, perhaps remove this line & set 'debug': True, below? (or 'debug': VAR_WHICH_IS_TRUE_IN_TESTING_ONLY to avoid enabling debug templates in prod?)

If you get a :code:`django.core.exceptions.ImproperlyConfigured` error,
you need to set the :code:`DJANGO_SETTINGS_MODULE` environment variable.

If you get :code:`django_coverage_plugin.plugin.DjangoTemplatePluginException: Template debugging must be enabled in settings`, change your TEMPLATES setting:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that when using pytest, the check which can raise this exception doesn't actually run properly (#73) so it might help to mention here "...or if you are using pytest and getting 0% coverage (issue #73)"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of coveragepy/coveragepy@30c023b, the check is now a real Python warning, so pytest will display it.

@christopherpickering
Copy link

@nedbat wonder if this can be merged? Thanks!

@nedbat
Copy link
Member

nedbat commented May 31, 2021

Thanks, I'll merge this and then make some tweaks.

@nedbat nedbat merged commit a66dcfb into coveragepy:master May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants