Commit 62a0dbcd authored by Kurt Griffiths's avatar Kurt Griffiths

fix: Revert breaking change and fix README RST syntax warning

Fixes #1204
Fixes #1205
parent efccc223
1.4.1
==========================
Fixed
-----
- Reverted the breaking change in 1.4.0 to ``falcon.testing.Result.json``.
Minor releases should have no breaking changes.
- The README was not rendering properly on PyPI. This was fixed and a validation
step was added to the build process.
1.4.0
=====
Breaking Changes
----------------
(None)
- ``testing.Result.json`` now returns ``None`` when the response body is
empty, rather than raising an error.
Changes to Supported Platforms
------------------------------
......@@ -47,8 +59,6 @@ New & Improved
override ``TestClient``'s behavior.
- ``TestClient`` can now be configured with a default set of headers to
send with every request.
- ``testing.Result.json`` now returns None when the response body is
empty, rather than raising an error.
- The FAQ has been reorganized and greatly expanded.
- We restyled the docs to match https://falconframework.org
......
......@@ -6,6 +6,5 @@ include README.rst
include LICENSE
include docs/conf.py docs/Makefile
graft docs/_static
graft docs/_themes
graft docs/_templates
graft tools
|Docs| |Build Status| |codecov.io|
|Logo| The Falcon Web Framework
===========================
===============================
Perfection is finally attained not when there is no longer anything
to add, but when there is no longer anything to take away.
......
......@@ -4,7 +4,8 @@ Changelog for Falcon 1.4.0
Breaking Changes
----------------
(None)
- :attr:`falcon.testing.Result.json` now returns None when the response body is
empty, rather than raising an error.
Changes to Supported Platforms
------------------------------
......@@ -49,8 +50,6 @@ New & Improved
override :class:`~.TestClient`'s behavior.
- :class:`~.TestClient` can now be configured with a default set of headers to
send with every request.
- :attr:`~.testing.Result.json` now returns None when the response body is
empty, rather than raising an error.
- The :ref:`FAQ <faq>` has been reorganized and greatly expanded.
- We restyled the docs to match https://falconframework.org
......
......@@ -3,6 +3,7 @@ Changelogs
.. toctree::
1.4.1 <1.4.1>
1.4.0 <1.4.0>
1.3.0 <1.3.0>
1.2.0 <1.2.0>
......
......@@ -72,9 +72,8 @@ class Result(object):
under Python 2.6 and 2.7, and of type ``str`` otherwise.
If the content type does not specify an encoding, UTF-8 is
assumed.
json (JSON serializable): Deserialized JSON body. Will be ``None`` if
the body has no content to deserialize. Otherwise, raises an error
if the response is not valid JSON.
json (dict): Deserialized JSON body. Raises ``JSONDecodeError`` if
the body is empty or not JSON.
"""
def __init__(self, iterable, status, headers):
......@@ -166,9 +165,6 @@ class Result(object):
@property
def json(self):
if not self.text:
return None
return util_json.loads(self.text)
......
......@@ -14,5 +14,5 @@
"""Falcon version."""
__version__ = '1.4.0'
__version__ = '1.4.1'
"""Current version of Falcon."""
......@@ -2,6 +2,10 @@
from datetime import datetime
import functools
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
import random
import pytest
......@@ -452,7 +456,8 @@ class TestFalconTestingUtils(object):
def test_wsgi_iterable_not_closeable(self):
result = testing.Result([], falcon.HTTP_200, [])
assert not result.content
assert result.json is None
with pytest.raises(JSONDecodeError):
result.json
def test_path_must_start_with_slash(self):
app = falcon.API()
......
......@@ -75,6 +75,19 @@ rm -rf $DIST_DIR
pyenv shell system
pyenv uninstall -f $VENV_NAME
#----------------------------------------------------------------------
# README validation
#----------------------------------------------------------------------
_echo_task "Checking that README will render on PyPI"
_open_env $PY2_VERSION
pip install readme_renderer
python setup.py check -r -s
_close_env
#----------------------------------------------------------------------
# Source distribution
#----------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment