mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-25 07:50:41 +03:00
Include coverage for tests (#5970)
It is useful to see if tests itself are covered after all - missing coverage there typically indicates dead/missed code paths. This also uses `source=.` and includes (with run and report), to help Codecov with reporting. Ref: https://github.com/encode/django-rest-framework/pull/5956
This commit is contained in:
parent
275c157341
commit
c17b4ad0d0
|
@ -91,10 +91,9 @@ if __name__ == "__main__":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
pytest_args = [
|
pytest_args = [
|
||||||
'--cov-report',
|
'--cov', '.',
|
||||||
'xml',
|
'--cov-report', 'xml',
|
||||||
'--cov',
|
] + pytest_args
|
||||||
'rest_framework'] + pytest_args
|
|
||||||
|
|
||||||
if first_arg.startswith('-'):
|
if first_arg.startswith('-'):
|
||||||
# `runtests.py [flags]`
|
# `runtests.py [flags]`
|
||||||
|
|
|
@ -19,3 +19,11 @@ multi_line_output=5
|
||||||
known_standard_library=types
|
known_standard_library=types
|
||||||
known_third_party=pytest,_pytest,django
|
known_third_party=pytest,_pytest,django
|
||||||
known_first_party=rest_framework
|
known_first_party=rest_framework
|
||||||
|
|
||||||
|
[coverage:run]
|
||||||
|
# NOTE: source is ignored with pytest-cov (but uses the same).
|
||||||
|
source = .
|
||||||
|
include = rest_framework/*,tests/*
|
||||||
|
branch = 1
|
||||||
|
[coverage:report]
|
||||||
|
include = rest_framework/*,tests/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user