Skip to content

Mark or remove uncovered example code #542

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

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions example/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
ArtProject,
Author,
AuthorBio,
AuthorBioMetadata,
AuthorType,
Blog,
Comment,
Company,
Entry,
ProjectType,
ResearchProject,
TaggedItem,
AuthorBioMetadata)
TaggedItem
)

faker = FakerFactory.create()
faker.seed(983843)
Expand Down Expand Up @@ -134,7 +135,7 @@ class Meta:

@factory.post_generation
def future_projects(self, create, extracted, **kwargs):
if not create:
if not create: # pragma: no cover
return
if extracted:
for project in extracted:
Expand Down
5 changes: 3 additions & 2 deletions example/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ArtProject,
Author,
AuthorBio,
AuthorBioMetadata,
AuthorType,
Blog,
Comment,
Expand All @@ -16,8 +17,8 @@
Project,
ProjectType,
ResearchProject,
TaggedItem,
AuthorBioMetadata)
TaggedItem
)


class TaggedItemSerializer(serializers.ModelSerializer):
Expand Down
2 changes: 1 addition & 1 deletion example/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from example.factories import (
ArtProjectFactory,
AuthorBioFactory,
AuthorFactory,
AuthorBioMetadataFactory,
AuthorFactory,
AuthorTypeFactory,
BlogFactory,
CommentFactory,
Expand Down
2 changes: 1 addition & 1 deletion example/tests/integration/test_non_paginated_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

try:
from unittest import mock
except ImportError:
except ImportError: # pragma: no cover
import mock

pytestmark = pytest.mark.django_db
Expand Down
2 changes: 1 addition & 1 deletion example/tests/integration/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

try:
from unittest import mock
except ImportError:
except ImportError: # pragma: no cover
import mock


Expand Down
2 changes: 1 addition & 1 deletion example/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

try:
from unittest import mock
except ImportError:
except ImportError: # pragma: no cover
import mock

request_factory = APIRequestFactory()
Expand Down
2 changes: 1 addition & 1 deletion example/tests/unit/test_default_drf_serializers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from datetime import datetime

import pytest
from datetime import datetime
from django.urls import reverse
from rest_framework import viewsets
from rest_framework.serializers import ModelSerializer, SerializerMethodField
Expand Down
3 changes: 0 additions & 3 deletions example/tests/unit/test_renderer_class_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ def test_extract_root_meta_many():


def test_extract_root_meta_invalid_meta():
def get_root_meta(resource, many):
return 'not a dict'

serializer = InvalidExtractRootMetaResourceSerializer()
with pytest.raises(AssertionError):
JSONRenderer.extract_root_meta(serializer, {})
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ source =
omit =
.tox/*
.eggs/*
example/urls.py
show_missing = True
exclude_lines =
pragma: no cover
Expand Down