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
replace use nose
by pytest
#970
base: master
Are you sure you want to change the base?
Conversation
pytest support still is not finished byt it is BetterTahNothing™️ . + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-flask-restful-0.3.10-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-flask-restful-0.3.10-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/flask-restful-0.3.10
collected 203 items / 2 errors
==================================== ERRORS ====================================
______________________ ERROR collecting tests/test_api.py ______________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-restful-0.3.10/tests/test_api.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_api.py:4: in <module>
from flask.signals import got_request_exception, signals_available
E ImportError: cannot import name 'signals_available' from 'flask.signals' (/usr/lib/python3.8/site-packages/flask/signals.py)
____________________ ERROR collecting tests/test_inputs.py _____________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-restful-0.3.10/tests/test_inputs.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_inputs.py:9: in <module>
from flask_restful import inputs
flask_restful/inputs.py:6: in <module>
import aniso8601
E ModuleNotFoundError: No module named 'aniso8601'
=============================== warnings summary ===============================
tests/test_fields.py:28
tests/test_fields.py:28: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_float will be ignored
def test_float():
tests/test_fields.py:38
tests/test_fields.py:38: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_boolean will be ignored
def test_boolean():
tests/test_fields.py:50
tests/test_fields.py:50: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_rfc822_datetime_formatters will be ignored
def test_rfc822_datetime_formatters():
tests/test_fields.py:64
tests/test_fields.py:64: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_iso8601_datetime_formatters will be ignored
def test_iso8601_datetime_formatters():
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/test_api.py
ERROR tests/test_inputs.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
======================== 4 warnings, 2 errors in 0.38s ========================= Above fails because I have no packaged |
With added those two files to --ignore list pytest shows more issues: + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-flask-restful-0.3.10-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-flask-restful-0.3.10-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' --ignore tests/test_api.py --ignore tests/test_inputs.py
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/flask-restful-0.3.10
collected 203 items
tests/test_accept.py ............ [ 5%]
tests/test_api_with_blueprint.py ............. [ 12%]
tests/test_cors.py .... [ 14%]
tests/test_fields.py xxxx............................................... [ 39%]
.................... [ 49%]
tests/test_reqparse.py ...........................F.................FFFF [ 73%]
F.FFFFFFFFFFF..FFFFFFFFFF.FFFF.F.F......FFFFF...F..... [100%]
=================================== FAILURES ===================================
_____________________ ReqParseTestCase.test_json_location ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_json_location>
def test_json_location(self):
app = Flask(__name__)
parser = RequestParser()
parser.add_argument("foo", location="json", store_missing=True)
with app.test_request_context('/bubble', method="post"):
> args = parser.parse_args()
tests/test_reqparse.py:252:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:117: in source
value = getattr(request, self.location, MultiDict())
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
/usr/lib/python3.8/site-packages/flask/wrappers.py:130: in on_json_loading_failed
return super().on_json_loading_failed(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [POST]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_________________________ ReqParseTestCase.test_parse __________________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse>
def test_parse(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo"),
> args = parser.parse_args(req)
tests/test_reqparse.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
______________________ ReqParseTestCase.test_parse_append ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_append>
def test_parse_append(self):
req = Request.from_values("/bubble?foo=bar&foo=bat")
parser = RequestParser()
parser.add_argument("foo", action="append"),
> args = parser.parse_args(req)
tests/test_reqparse.py:292:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar&foo=bat' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_parse_append_default __________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_append_default>
def test_parse_append_default(self):
req = Request.from_values("/bubble?")
parser = RequestParser()
parser.add_argument("foo", action="append", store_missing=True),
> args = parser.parse_args(req)
tests/test_reqparse.py:283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_parse_append_ignore ___________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_append_ignore>
def test_parse_append_ignore(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo", ignore=True, type=int, action="append",
store_missing=True),
> args = parser.parse_args(req)
tests/test_reqparse.py:274:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
___________________ ReqParseTestCase.test_parse_append_many ____________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_append_many>
def test_parse_append_many(self):
req = Request.from_values("/bubble?foo=bar&foo=bar2")
parser = RequestParser()
parser.add_argument("foo", action="append"),
> args = parser.parse_args(req)
tests/test_reqparse.py:310:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar&foo=bar2' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_parse_append_single ___________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_append_single>
def test_parse_append_single(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo", action="append"),
> args = parser.parse_args(req)
tests/test_reqparse.py:301:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_________________ ReqParseTestCase.test_parse_callable_default _________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_callable_default>
def test_parse_callable_default(self):
req = Request.from_values("/bubble")
parser = RequestParser()
parser.add_argument("foo", default=lambda: "bar", store_missing=True)
> args = parser.parse_args(req)
tests/test_reqparse.py:510:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________________ ReqParseTestCase.test_parse_choices ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_choices>
def test_parse_choices(self):
app = Flask(__name__)
with app.app_context():
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo", choices=["bat"]),
> self.assertRaises(exceptions.BadRequest, lambda: parser.parse_args(req))
tests/test_reqparse.py:557:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_reqparse.py:557: in <lambda>
self.assertRaises(exceptions.BadRequest, lambda: parser.parse_args(req))
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_________________ ReqParseTestCase.test_parse_choices_correct __________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_choices_correct>
def test_parse_choices_correct(self):
req = Request.from_values("/bubble?foo=bat")
parser = RequestParser()
parser.add_argument("foo", choices=["bat"]),
> args = parser.parse_args(req)
tests/test_reqparse.py:546:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bat' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_______________ ReqParseTestCase.test_parse_choices_insensitive ________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_choices_insensitive>
def test_parse_choices_insensitive(self):
req = Request.from_values("/bubble?foo=BAT")
parser = RequestParser()
parser.add_argument("foo", choices=["bat"], case_sensitive=False),
> args = parser.parse_args(req)
tests/test_reqparse.py:575:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=BAT' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
________________ ReqParseTestCase.test_parse_choices_sensitive _________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_choices_sensitive>
def test_parse_choices_sensitive(self):
app = Flask(__name__)
with app.app_context():
req = Request.from_values("/bubble?foo=BAT")
parser = RequestParser()
parser.add_argument("foo", choices=["bat"], case_sensitive=True),
> self.assertRaises(exceptions.BadRequest, lambda: parser.parse_args(req))
tests/test_reqparse.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_reqparse.py:567: in <lambda>
self.assertRaises(exceptions.BadRequest, lambda: parser.parse_args(req))
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________________ ReqParseTestCase.test_parse_default ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_default>
def test_parse_default(self):
req = Request.from_values("/bubble")
parser = RequestParser()
parser.add_argument("foo", default="bar", store_missing=True)
> args = parser.parse_args(req)
tests/test_reqparse.py:501:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_parse_default_append __________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_default_append>
def test_parse_default_append(self):
req = Request.from_values("/bubble")
parser = RequestParser()
parser.add_argument("foo", default="bar", action="append",
store_missing=True)
> args = parser.parse_args(req)
tests/test_reqparse.py:491:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_______________________ ReqParseTestCase.test_parse_dest _______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_dest>
def test_parse_dest(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo", dest="bat")
> args = parser.parse_args(req)
tests/test_reqparse.py:331:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
________________________ ReqParseTestCase.test_parse_eq ________________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_eq>
def test_parse_eq(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo"),
> args = parser.parse_args(req)
tests/test_reqparse.py:400:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________________ ReqParseTestCase.test_parse_eq_other _____________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_eq_other>
def test_parse_eq_other(self):
parser = RequestParser()
parser.add_argument("foo"),
> args = parser.parse_args(Request.from_values("/bubble?foo=bar&foo=bat"))
tests/test_reqparse.py:393:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar&foo=bat' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
____________ ReqParseTestCase.test_parse_foo_operators_four_hunderd ____________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_foo_operators_four_hunderd>
def test_parse_foo_operators_four_hunderd(self):
app = Flask(__name__)
with app.app_context():
parser = RequestParser()
parser.add_argument("foo", type=int),
> self.assertRaises(exceptions.BadRequest, lambda: parser.parse_args(Request.from_values("/bubble?foo=bar")))
tests/test_reqparse.py:358:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_reqparse.py:358: in <lambda>
self.assertRaises(exceptions.BadRequest, lambda: parser.parse_args(Request.from_values("/bubble?foo=bar")))
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_______________ ReqParseTestCase.test_parse_foo_operators_ignore _______________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_foo_operators_ignore>
def test_parse_foo_operators_ignore(self):
parser = RequestParser()
parser.add_argument("foo", ignore=True, store_missing=True)
> args = parser.parse_args(Request.from_values("/bubble"))
tests/test_reqparse.py:364:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_______________________ ReqParseTestCase.test_parse_gte ________________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_gte>
def test_parse_gte(self):
req = Request.from_values("/bubble?foo>=bar")
parser = RequestParser()
parser.add_argument("foo", operators=[">="])
> args = parser.parse_args(req)
tests/test_reqparse.py:349:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo>=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
____________________ ReqParseTestCase.test_parse_gte_lte_eq ____________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_gte_lte_eq>
def test_parse_gte_lte_eq(self):
req = Request.from_values("/bubble?foo>=bar&foo<=bat&foo=foo")
parser = RequestParser()
parser.add_argument("foo", operators=[">=", "<=", "="], action="append"),
> args = parser.parse_args(req)
tests/test_reqparse.py:340:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo>=bar&foo<=bat&foo=foo' [GET]>
e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
______________________ ReqParseTestCase.test_parse_ignore ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_ignore>
def test_parse_ignore(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument("foo", type=int, ignore=True, store_missing=True),
> args = parser.parse_args(req)
tests/test_reqparse.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_______________________ ReqParseTestCase.test_parse_lte ________________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_lte>
def test_parse_lte(self):
req = Request.from_values("/bubble?foo<=bar")
parser = RequestParser()
parser.add_argument("foo", operators=["<="])
> args = parser.parse_args(req)
tests/test_reqparse.py:408:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo<=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_parse_lte_gte_append __________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_lte_gte_append>
def test_parse_lte_gte_append(self):
parser = RequestParser()
parser.add_argument("foo", operators=["<=", "="], action="append")
> args = parser.parse_args(Request.from_values("/bubble?foo<=bar"))
tests/test_reqparse.py:381:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo<=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_________________ ReqParseTestCase.test_parse_lte_gte_missing __________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_lte_gte_missing>
def test_parse_lte_gte_missing(self):
parser = RequestParser()
parser.add_argument("foo", operators=["<=", "="])
> args = parser.parse_args(Request.from_values("/bubble?foo<=bar"))
tests/test_reqparse.py:387:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo<=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
___________________ ReqParseTestCase.test_parse_lte_gte_mock ___________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_lte_gte_mock>
def test_parse_lte_gte_mock(self):
mock_type = Mock()
req = Request.from_values("/bubble?foo<=bar")
parser = RequestParser()
parser.add_argument("foo", type=mock_type, operators=["<="])
> parser.parse_args(req)
tests/test_reqparse.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo<=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_______________________ ReqParseTestCase.test_parse_none _______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_none>
def test_parse_none(self):
req = Request.from_values("/bubble")
parser = RequestParser()
parser.add_argument("foo")
> args = parser.parse_args(req)
tests/test_reqparse.py:528:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_parse_store_missing ___________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_store_missing>
def test_parse_store_missing(self):
req = Request.from_values("/bubble")
parser = RequestParser()
parser.add_argument("foo", store_missing=False)
> args = parser.parse_args(req)
tests/test_reqparse.py:537:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________________ ReqParseTestCase.test_parse_unicode ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_unicode>
def test_parse_unicode(self):
req = Request.from_values("/bubble?foo=barß")
parser = RequestParser()
parser.add_argument("foo")
> args = parser.parse_args(req)
tests/test_reqparse.py:232:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=barß' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
___________________ ReqParseTestCase.test_parse_unicode_app ____________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_parse_unicode_app>
def test_parse_unicode_app(self):
app = Flask(__name__)
parser = RequestParser()
parser.add_argument("foo")
with app.test_request_context('/bubble?foo=barß'):
> args = parser.parse_args()
tests/test_reqparse.py:242:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
/usr/lib/python3.8/site-packages/flask/wrappers.py:130: in on_json_loading_failed
return super().on_json_loading_failed(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=barß' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
________________ ReqParseTestCase.test_passing_arguments_object ________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_passing_arguments_object>
def test_passing_arguments_object(self):
req = Request.from_values("/bubble?foo=bar")
parser = RequestParser()
parser.add_argument(Argument("foo"))
> args = parser.parse_args(req)
tests/test_reqparse.py:718:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=bar' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_request_parser_copy ___________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_request_parser_copy>
def test_request_parser_copy(self):
req = Request.from_values("/bubble?foo=101&bar=baz")
parser = RequestParser()
foo_arg = Argument('foo', type=int)
parser.args.append(foo_arg)
parser_copy = parser.copy()
# Deepcopy should create a clone of the argument object instead of
# copying a reference to the new args list
self.assertFalse(foo_arg in parser_copy.args)
# Args added to new parser should not be added to the original
bar_arg = Argument('bar')
parser_copy.args.append(bar_arg)
self.assertFalse(bar_arg in parser.args)
> args = parser_copy.parse_args(req)
tests/test_reqparse.py:769:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=101&bar=baz' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
____________ ReqParseTestCase.test_request_parser_replace_argument _____________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_request_parser_replace_argument>
def test_request_parser_replace_argument(self):
req = Request.from_values("/bubble?foo=baz")
parser = RequestParser()
parser.add_argument('foo', type=int)
parser_copy = parser.copy()
parser_copy.replace_argument('foo')
> args = parser_copy.parse_args(req)
tests/test_reqparse.py:787:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=baz' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________ ReqParseTestCase.test_strict_parsing_off_partial_hit _____________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_strict_parsing_off_partial_hit>
def test_strict_parsing_off_partial_hit(self):
req = Request.from_values("/bubble?foo=1&bar=bees&n=22")
parser = RequestParser()
parser.add_argument('foo', type=int)
> args = parser.parse_args(req)
tests/test_reqparse.py:839:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=1&bar=bees&n=22' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
___________________ ReqParseTestCase.test_strict_parsing_on ____________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_strict_parsing_on>
def test_strict_parsing_on(self):
req = Request.from_values("/bubble?foo=baz")
parser = RequestParser()
> self.assertRaises(exceptions.BadRequest, parser.parse_args, req, strict=True)
tests/test_reqparse.py:833:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:325: in parse_args
req.unparsed_arguments = dict(self.argument_class('').source(req)) if strict else {}
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________ ReqParseTestCase.test_strict_parsing_on_partial_hit ______________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_strict_parsing_on_partial_hit>
def test_strict_parsing_on_partial_hit(self):
req = Request.from_values("/bubble?foo=1&bar=bees&n=22")
parser = RequestParser()
parser.add_argument('foo', type=int)
> self.assertRaises(exceptions.BadRequest, parser.parse_args, req, strict=True)
tests/test_reqparse.py:846:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:325: in parse_args
req.unparsed_arguments = dict(self.argument_class('').source(req)) if strict else {}
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________________ ReqParseTestCase.test_trim_argument ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_trim_argument>
def test_trim_argument(self):
req = Request.from_values("/bubble?foo= 1 &bar=bees&n=22")
parser = RequestParser()
parser.add_argument('foo')
> args = parser.parse_args(req)
tests/test_reqparse.py:852:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=%201%20&bar=bees&n=22' [GET]>
e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
__________________ ReqParseTestCase.test_trim_request_parser ___________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_trim_request_parser>
def test_trim_request_parser(self):
req = Request.from_values("/bubble?foo= 1 &bar=bees&n=22")
parser = RequestParser(trim=False)
parser.add_argument('foo')
> args = parser.parse_args(req)
tests/test_reqparse.py:869:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=%201%20&bar=bees&n=22' [GET]>
e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
_____________________ ReqParseTestCase.test_type_callable ______________________
self = <tests.test_reqparse.ReqParseTestCase testMethod=test_type_callable>
def test_type_callable(self):
req = Request.from_values("/bubble?foo=1")
parser = RequestParser()
parser.add_argument("foo", type=lambda x: x, required=False),
> args = parser.parse_args(req)
tests/test_reqparse.py:635:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
flask_restful/reqparse.py:328: in parse_args
value, found = arg.parse(req, self.bundle_errors)
flask_restful/reqparse.py:184: in parse
source = self.source(request)
flask_restful/reqparse.py:125: in source
value = getattr(request, l, None)
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:558: in json
return self.get_json()
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:604: in get_json
return self.on_json_loading_failed(None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Request 'http://localhost/bubble?foo=1' [GET]>, e = None
def on_json_loading_failed(self, e: ValueError | None) -> t.Any:
"""Called if :meth:`get_json` fails and isn't silenced.
If this method returns a value, it is used as the return value
for :meth:`get_json`. The default implementation raises
:exc:`~werkzeug.exceptions.BadRequest`.
:param e: If parsing failed, this is the exception. It will be
``None`` if the content type wasn't ``application/json``.
.. versionchanged:: 2.3
Raise a 415 error instead of 400.
"""
if e is not None:
raise BadRequest(f"Failed to decode JSON object: {e}")
> raise UnsupportedMediaType(
"Did not attempt to load JSON data because the request"
" Content-Type was not 'application/json'."
)
E werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
/usr/lib/python3.8/site-packages/werkzeug/wrappers/request.py:647: UnsupportedMediaType
=============================== warnings summary ===============================
tests/test_fields.py:28
tests/test_fields.py:28: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_float will be ignored
def test_float():
tests/test_fields.py:38
tests/test_fields.py:38: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_boolean will be ignored
def test_boolean():
tests/test_fields.py:50
tests/test_fields.py:50: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_rfc822_datetime_formatters will be ignored
def test_rfc822_datetime_formatters():
tests/test_fields.py:64
tests/test_fields.py:64: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_iso8601_datetime_formatters will be ignored
def test_iso8601_datetime_formatters():
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
XFAIL tests/test_fields.py::test_float - reason: [NOTRUN] yield tests were removed in pytest 4.0 - test_float will be ignored
XFAIL tests/test_fields.py::test_boolean - reason: [NOTRUN] yield tests were removed in pytest 4.0 - test_boolean will be ignored
XFAIL tests/test_fields.py::test_rfc822_datetime_formatters - reason: [NOTRUN] yield tests were removed in pytest 4.0 - test_rfc822_datetime_formatters will be ignored
XFAIL tests/test_fields.py::test_iso8601_datetime_formatters - reason: [NOTRUN] yield tests were removed in pytest 4.0 - test_iso8601_datetime_formatters will be ignored
FAILED tests/test_reqparse.py::ReqParseTestCase::test_json_location - werkzeu...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse - werkzeug.except...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_append - werkzeug...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_append_default - ...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_append_ignore - w...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_append_many - wer...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_append_single - w...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_callable_default
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_choices - werkzeu...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_choices_correct
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_choices_insensitive
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_choices_sensitive
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_default - werkzeu...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_default_append - ...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_dest - werkzeug.e...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_eq - werkzeug.exc...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_eq_other - werkze...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_foo_operators_four_hunderd
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_foo_operators_ignore
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_gte - werkzeug.ex...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_gte_lte_eq - werk...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_ignore - werkzeug...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_lte - werkzeug.ex...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_lte_gte_append - ...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_lte_gte_missing
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_lte_gte_mock - we...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_none - werkzeug.e...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_store_missing - w...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_unicode - werkzeu...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_parse_unicode_app - wer...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_passing_arguments_object
FAILED tests/test_reqparse.py::ReqParseTestCase::test_request_parser_copy - w...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_request_parser_replace_argument
FAILED tests/test_reqparse.py::ReqParseTestCase::test_strict_parsing_off_partial_hit
FAILED tests/test_reqparse.py::ReqParseTestCase::test_strict_parsing_on - wer...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_strict_parsing_on_partial_hit
FAILED tests/test_reqparse.py::ReqParseTestCase::test_trim_argument - werkzeu...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_trim_request_parser - w...
FAILED tests/test_reqparse.py::ReqParseTestCase::test_type_callable - werkzeu...
============ 39 failed, 160 passed, 4 xfailed, 4 warnings in 2.40s ============= So looks like more pytest cleanups needs to be applied. |
Drop use `nose` and replace it by `pytesr` using `nose2pytest` module + some manual changes. `nose` is deprecated and should not be used with python 3.x https://nose.readthedocs.io/en/latest/ Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Nice. do you know if this repo is still maintained? it takes too long for open pull request to be reviewed and merged |
Have no idea .. |
@@ -34,7 +33,7 @@ def setup_propagate_exceptions(propagate_exceptions): | |||
|
|||
|
|||
def check_unpack(expected, value): | |||
assert_equal(expected, value) | |||
assert expected == value | |||
|
|||
|
|||
def test_unpack(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_unpack will be ignored
Drop use
nose
and replace it bypytesr
usingnose2pytest
modulenose
is deprecated and hould not be used with python 3.x https://nose.readthedocs.io/en/latest/