From 0e10d32fb122619a7977909536b642d09603192a Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Sun, 24 Jun 2018 17:56:31 -0400 Subject: [PATCH] Add NotImplementedError to coverage exclusion (#6057) --- setup.cfg | 4 ++++ tests/test_viewsets.py | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index c265761ba..75a1e9db0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,5 +25,9 @@ known_first_party=rest_framework source = . include = rest_framework/*,tests/* branch = 1 + [coverage:report] include = rest_framework/*,tests/* +exclude_lines = + pragma: no cover + raise NotImplementedError diff --git a/tests/test_viewsets.py b/tests/test_viewsets.py index a4d0ffb69..caed6f2f6 100644 --- a/tests/test_viewsets.py +++ b/tests/test_viewsets.py @@ -35,26 +35,26 @@ class ActionViewSet(GenericViewSet): queryset = Action.objects.all() def list(self, request, *args, **kwargs): - raise NotImplementedError() # pragma: no cover + raise NotImplementedError def retrieve(self, request, *args, **kwargs): - raise NotImplementedError() # pragma: no cover + raise NotImplementedError @action(detail=False) def list_action(self, request, *args, **kwargs): - raise NotImplementedError() # pragma: no cover + raise NotImplementedError @action(detail=False, url_name='list-custom') def custom_list_action(self, request, *args, **kwargs): - raise NotImplementedError() # pragma: no cover + raise NotImplementedError @action(detail=True) def detail_action(self, request, *args, **kwargs): - raise NotImplementedError() # pragma: no cover + raise NotImplementedError @action(detail=True, url_name='detail-custom') def custom_detail_action(self, request, *args, **kwargs): - raise NotImplementedError() # pragma: no cover + raise NotImplementedError router = SimpleRouter()