Skip to content
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

Added support to not send responses when the handler has already called finish() #108

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

vivekfantain
Copy link

I found a bug that caused Tornado to fail because we are sending message after calling finished(). I had submitted an earlier patch that didn't pass tests. This version should. Hopefully!

@hfaran
Copy link
Owner

hfaran commented Apr 17, 2019

Hmm, not sure if the test failures here are related to your change; maybe a breaking change in jsonschema. I'll take a look.

@hfaran hfaran self-requested a review April 17, 2019 08:43
@hfaran hfaran changed the title 1.3.3 local Added support to not send responses when the handler has already called finish() Apr 17, 2019
@hfaran
Copy link
Owner

hfaran commented Apr 17, 2019

@vivekfantain I just pushed #111 which pins some dependencies to fix the failing tests. Can you merge from the latest upstream master? That should fix it.

@vivekfantain
Copy link
Author

Now I have a new issue

platform darwin -- Python 2.7.15, pytest-3.10.1, py-1.8.0, pluggy-0.9.0 -- /Users/vivekv/projects/Tornado-JSON/.tox/py27-tornado3/bin/python
cachedir: .pytest_cache
rootdir: /Users/vivekv/projects/Tornado-JSON, inifile:
plugins: cov-2.6.0
collected 28 items                                                                                                                                                                                               

tests/func_test.py::APIFunctionalTest::test_asynchronous_handler PASSED                                                                                                                                    [  3%]
tests/func_test.py::APIFunctionalTest::test_db_conn PASSED                                                                                                                                                 [  7%]
tests/func_test.py::APIFunctionalTest::test_empty_resource PASSED                                                                                                                                          [ 10%]
tests/func_test.py::APIFunctionalTest::test_post_custom_validator_class PASSED                                                                                                                             [ 14%]
tests/func_test.py::APIFunctionalTest::test_post_request PASSED                                                                                                                                            [ 17%]
tests/func_test.py::APIFunctionalTest::test_post_schema_with_default_but_use_defaults_false PASSED                                                                                                         [ 21%]
tests/func_test.py::APIFunctionalTest::test_post_use_defaults PASSED                                                                                                                                       [ 25%]
tests/func_test.py::APIFunctionalTest::test_post_use_defaults_no_need_of_default PASSED                                                                                                                    [ 28%]
tests/func_test.py::APIFunctionalTest::test_synchronous_handler PASSED                                                                                                                                     [ 32%]
tests/func_test.py::APIFunctionalTest::test_url_pattern_route PASSED                                                                                                                                       [ 35%]
tests/func_test.py::APIFunctionalTest::test_view_db_conn PASSED                                                                                                                                            [ 39%]
tests/func_test.py::APIFunctionalTest::test_write_error PASSED                                                                                                                                             [ 42%]
tests/test_api_doc_gen.py::test__get_tuple_from_route PASSED                                                                                                                                               [ 46%]
tests/test_api_doc_gen.py::test__get_api_docs PASSED                                                                                                                                                       [ 50%]
tests/test_api_doc_gen.py::test___get_notes PASSED                                                                                                                                                         [ 53%]
tests/test_schema.py::TestSchemaMethods::test_defaults_basic PASSED                                                                                                                                        [ 57%]
tests/test_schema.py::TestSchemaMethods::test_defaults_nested_object_default PASSED                                                                                                                        [ 60%]
tests/test_schema.py::TestSchemaMethods::test_defaults_no_defaults PASSED                                                                                                                                  [ 64%]
tests/test_schema.py::TestSchemaMethods::test_input_schema_clean PASSED                                                                                                                                    [ 67%]
tests/test_schema.py::TestSchemaMethods::test_input_schema_clean_ignore_other_types PASSED                                                                                                                 [ 71%]
tests/test_schema.py::TestSchemaMethods::test_input_schema_clean_no_defaults PASSED                                                                                                                        [ 75%]
tests/test_tornado_json.py::TestRoutes::test_get_routes PASSED                                                                                                                                             [ 78%]
tests/test_tornado_json.py::TestRoutes::test_gen_submodule_names PASSED                                                                                                                                    [ 82%]
tests/test_tornado_json.py::TestRoutes::test_get_module_routes PASSED                                                                                                                                      [ 85%]
tests/test_tornado_json.py::TestUtils::test_api_assert PASSED                                                                                                                                              [ 89%]
tests/test_tornado_json.py::TestJSendMixin::test_success FAILED                                                                                                                                            [ 92%]
tests/test_tornado_json.py::TestJSendMixin::test_fail FAILED                                                                                                                                               [ 96%]
tests/test_tornado_json.py::TestJSendMixin::test_error FAILED                                                                                                                                              [100%]

==================================================================================================== FAILURES ====================================================================================================
__________________________________________________________________________________________ TestJSendMixin.test_success ___________________________________________________________________________________________

self = <tests.test_tornado_json.TestJSendMixin object at 0x10217ea50>

    def test_success(self):
        """Tests JSendMixin.success"""
        data = "Huzzah!"
>       self.jsend_rh.success(data)
E       AttributeError: 'TestJSendMixin' object has no attribute 'jsend_rh'

tests/test_tornado_json.py:180: AttributeError
____________________________________________________________________________________________ TestJSendMixin.test_fail ____________________________________________________________________________________________

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants