Skip to content

Update test requirements #5626

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 4 commits into from
Nov 26, 2017
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
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ skip=.tox
atomic=true
multi_line_output=5
known_standard_library=types
known_third_party=pytest,django
known_third_party=pytest,_pytest,django
known_first_party=rest_framework
6 changes: 3 additions & 3 deletions requirements/requirements-codestyle.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PEP8 code linting, which we run on all commits.
flake8==3.4.1
flake8==3.5.0
flake8-tidy-imports==1.1.0
pep8==1.7.0
pycodestyle==2.3.1

# Sort and lint imports
isort==4.2.5
isort==4.2.15
2 changes: 1 addition & 1 deletion requirements/requirements-optionals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
pytz==2017.2
markdown==2.6.4
django-guardian==1.4.9
django-filter==1.0.4
django-filter==1.1.0
coreapi==2.3.1
coreschema==0.0.4
2 changes: 1 addition & 1 deletion requirements/requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PyTest for running the tests.
pytest==3.2.2
pytest==3.2.5
pytest-django==3.1.2
pytest-cov==2.5.1
2 changes: 1 addition & 1 deletion rest_framework/schemas/inspectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def get_path_fields(self, path, method):
# Attempt to infer a field description if possible.
try:
model_field = model._meta.get_field(variable)
except:
except Exception:
model_field = None

if model_field is not None and model_field.verbose_name:
Expand Down
1 change: 1 addition & 0 deletions rest_framework/templatetags/rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.utils.encoding import force_text, iri_to_uri
from django.utils.html import escape, format_html, smart_urlquote
from django.utils.safestring import SafeData, mark_safe

from rest_framework.compat import apply_markdown, pygments_highlight
from rest_framework.renderers import HTMLFormRenderer
from rest_framework.utils.urls import replace_query_param
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/utils/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def default(self, obj):
elif hasattr(obj, '__getitem__'):
try:
return dict(obj)
except:
except Exception:
pass
elif hasattr(obj, '__iter__'):
return tuple(item for item in obj)
Expand Down
1 change: 0 additions & 1 deletion rest_framework/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# Robust filter and exist implementations. Ensures that queryset.exists() for
# an invalid value returns `False`, rather than raising an error.
# Refs https://github.com/encode/django-rest-framework/issues/3381

def qs_exists(queryset):
try:
return queryset.exists()
Expand Down
1 change: 1 addition & 0 deletions tests/importable/test_installed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf import settings

from tests import importable


Expand Down
2 changes: 1 addition & 1 deletion tests/test_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
}]
```"""


# If markdown is installed we also test it's working
# (and that our wrapped forces '=' to h2 and '-' to h3)

MARKED_DOWN_HILITE = """
<div class="highlight"><pre><span></span><span \
class="p">[{</span><br /> <span class="nt">&quot;alpha&quot;</span><span\
Expand Down
1 change: 0 additions & 1 deletion tests/test_one_to_one_with_inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


# Regression test for #4290

class ChildAssociatedModel(RESTFrameworkModel):
child_model = models.OneToOneField(ChildModel, on_delete=models.CASCADE)
child_name = models.CharField(max_length=100)
Expand Down