2017-03-05 07:38:18 +01:00
|
|
|
[report]
|
|
|
|
# Regexes for lines to exclude from consideration
|
|
|
|
exclude_lines =
|
|
|
|
# Re-enable the standard coverage pragma
|
2017-03-05 08:01:50 +01:00
|
|
|
nocoverage
|
2017-03-05 07:40:56 +01:00
|
|
|
# Don't complain if non-runnable code isn't run:
|
|
|
|
if False:
|
2017-03-05 07:47:22 +01:00
|
|
|
# Don't require coverage for base class NotImplementedErrors
|
|
|
|
raise NotImplementedError()
|
2017-03-05 08:01:50 +01:00
|
|
|
# Don't require coverage for test suite AssertionError -- they're usually for clarity
|
|
|
|
raise AssertionError
|
2017-10-27 09:06:40 +02:00
|
|
|
# Don't require coverage for __str__ statements just used for printing
|
2023-03-08 22:18:59 +01:00
|
|
|
def __(repr|str)__[(]self[)] -> .*:
|
2018-05-22 16:45:21 +02:00
|
|
|
# Don't require coverage for errors about unsupported webhook event types
|
2022-11-17 09:30:48 +01:00
|
|
|
raise UnsupportedWebhookEventTypeError
|
2019-07-30 20:58:48 +02:00
|
|
|
# Don't require coverage for blocks only run when type-checking
|
|
|
|
if TYPE_CHECKING:
|
2020-04-02 23:00:56 +02:00
|
|
|
# Don't require coverage for abstract methods; they're never called.
|
|
|
|
@abstractmethod
|
2019-11-13 08:17:49 +01:00
|
|
|
# PEP 484 overloading syntax
|
|
|
|
^\s*\.\.\.
|
2022-02-11 19:43:55 +01:00
|
|
|
# Skipped unit tests
|
|
|
|
@skip
|
2017-03-05 07:38:18 +01:00
|
|
|
|
|
|
|
[run]
|
2020-02-19 15:53:12 +01:00
|
|
|
data_file=var/.coverage
|
2022-05-14 22:52:31 +02:00
|
|
|
|
|
|
|
# dynamic_context=test_function, combined with using
|
|
|
|
# html_report(..., show_contexts=True), means the HTML report can detail
|
|
|
|
# which test(s) executed each line with coverage. This has modest
|
|
|
|
# overhead but is very useful for finding existing tests for a code path.
|
|
|
|
dynamic_context=test_function
|
|
|
|
|
2017-03-05 07:38:18 +01:00
|
|
|
omit =
|
|
|
|
*/zulip-venv-cache/*
|
|
|
|
*/migrations/*
|
|
|
|
*/management/commands/*
|
2017-07-05 23:40:55 +02:00
|
|
|
# Parts of the test runner infrastructure
|
2017-05-30 00:30:47 +02:00
|
|
|
tools/test-backend
|
|
|
|
zerver/lib/test_fixtures.py
|
|
|
|
zerver/lib/test_runner.py
|
2018-05-16 02:15:33 +02:00
|
|
|
# Has its own independent test suite
|
2019-08-04 18:14:48 +02:00
|
|
|
zerver/openapi/python_examples.py
|
2018-05-16 02:17:09 +02:00
|
|
|
# Debugging tools that don't lend themselves well to unit tests
|
|
|
|
zerver/lib/debug.py
|
2018-04-26 07:38:54 +02:00
|
|
|
# Part of provisioning/populate_db
|
|
|
|
zerver/lib/generate_test_data.py
|
2017-07-05 23:40:55 +02:00
|
|
|
# Excluded because its coverage state is flaky.
|
|
|
|
zerver/tornado/ioloop_logging.py
|
|
|
|
# Zulip's library for use in scripts
|
2017-05-30 00:30:47 +02:00
|
|
|
scripts/lib/zulip_tools.py
|
2018-04-26 07:41:31 +02:00
|
|
|
# Used only for the legacy Zephyr integration, and unlikely to ever be unit-tested
|
|
|
|
zerver/lib/ccache.py
|
2018-05-15 22:55:01 +02:00
|
|
|
# Settings.py files are hard to test
|
|
|
|
zproject/*settings.py
|
2019-05-29 21:31:54 +02:00
|
|
|
# https://github.com/davidhalter/jedi/issues/1122
|
|
|
|
blub
|