-
-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into typing-prototype
- Loading branch information
Showing
24 changed files
with
351 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a final newline; trim trailing whitespace | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# Set default charset for sources | ||
[*.{html,js,py,pyx}] | ||
charset = utf-8 | ||
|
||
# 4 space indentation | ||
[*.{py,pyx}] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# 2 space indentation | ||
[*.{yaml,yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
:class:`FloatConverter`:Modified existing IntConverter class and added FloatConverter class to convert string to float at runtime. | ||
Similar to the existing :class:`~falcon.routing.IntConverter`, a new | ||
:class:`~falcon.routing.FloatConverter` has been added, allowing to convert | ||
path segments to ``float``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Following the recommendation from | ||
`RFC 9239 <https://www.rfc-editor.org/rfc/rfc9239>`__, the | ||
:ref:`MEDIA_JS <media_type_constants>` constant has been updated to | ||
``text/javascript``. Furthermore, this and other media type constants are now | ||
preferred to the stdlib's :mod:`mimetypes` for the initialization of | ||
:attr:`~falcon.ResponseOptions.static_media_types`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
:ref:`WebSocket <ws>` implementation has been fixed to properly handle | ||
:class:`~falcon.HTTPError` and :class:`~falcon.HTTPStatus` exceptions raised by | ||
custom :func:`error handlers <falcon.asgi.App.add_error_handler>`. | ||
The WebSocket connection is now correctly closed with an appropriate code | ||
instead of bubbling up an unhandled error to the application server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Previously, importing :class:`~falcon.testing.TestCase` as a top-level | ||
attribute in a test module could make ``pytest`` erroneously attempt to collect | ||
its methods as test cases. This has now been prevented by adding a ``__test__`` | ||
attribute (set to ``False``) to the :class:`~falcon.testing.TestCase` class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
A new ``path`` :class:`converter <~falcon.routing.PathConverter>` | ||
A new ``path`` :class:`converter <falcon.routing.PathConverter>` | ||
capable of matching segments that include ``/`` was added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# misc test for 100% coverage | ||
|
||
from unittest.mock import MagicMock | ||
|
||
import pytest | ||
|
||
from falcon.asgi import App | ||
from falcon.http_error import HTTPError | ||
from falcon.http_status import HTTPStatus | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_http_status_not_impl(): | ||
app = App() | ||
with pytest.raises(NotImplementedError): | ||
await app._http_status_handler(MagicMock(), None, HTTPStatus(200), {}, None) | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_http_error_not_impl(): | ||
app = App() | ||
with pytest.raises(NotImplementedError): | ||
await app._http_error_handler(MagicMock(), None, HTTPError(400), {}, None) | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_python_error_not_impl(): | ||
app = App() | ||
with pytest.raises(NotImplementedError): | ||
await app._python_error_handler( | ||
MagicMock(), None, ValueError('error'), {}, None | ||
) |
Oops, something went wrong.