running pytest running egg_info writing src/apispec.egg-info/PKG-INFO writing dependency_links to src/apispec.egg-info/dependency_links.txt writing requirements to src/apispec.egg-info/requires.txt writing top-level names to src/apispec.egg-info/top_level.txt reading manifest file 'src/apispec.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'docs' warning: no previously-included files matching '*.pyo' found under directory 'docs' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyo' found under directory 'tests' no previously-included directories found matching 'docs/_build' adding license file 'LICENSE' writing manifest file 'src/apispec.egg-info/SOURCES.txt' running build_ext ============================= test session starts ============================== platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 rootdir: /build/python-apispec/src/apispec-5.1.1 collected 518 items tests/test_core.py ..................................................... [ 10%] ........................................................................ [ 24%] ......................... [ 28%] tests/test_ext_marshmallow.py .......................................... [ 37%] ........................................................................ [ 50%] ... [ 51%] tests/test_ext_marshmallow_common.py ............. [ 54%] tests/test_ext_marshmallow_field.py .................................... [ 61%] ........................................................................ [ 74%] .................. [ 78%] tests/test_ext_marshmallow_openapi.py .................................. [ 84%] ..........................................FF.................... [ 97%] tests/test_utils.py ...... [ 98%] tests/test_yaml_utils.py ........ [100%] =================================== FAILURES =================================== ________________________ test_openapi_tools_validate_v2 ________________________ spec = def validate_spec(spec): """Validate the output of an :class:`APISpec` object against the OpenAPI specification. Note: Requires installing apispec with the ``[validation]`` extras. :: pip install 'apispec[validation]' :raise: apispec.exceptions.OpenAPIError if validation fails. """ try: > import prance E ModuleNotFoundError: No module named 'prance' src/apispec/utils.py:58: ModuleNotFoundError During handling of the above exception, another exception occurred: def test_openapi_tools_validate_v2(): ma_plugin = MarshmallowPlugin() spec = APISpec( title="Pets", version="0.1", plugins=(ma_plugin,), openapi_version="2.0" ) openapi = ma_plugin.converter spec.components.schema("Category", schema=CategorySchema) spec.components.schema("Pet", {"discriminator": "name"}, schema=PetSchema) spec.path( view=None, path="/category/{category_id}", operations={ "get": { "parameters": [ {"name": "q", "in": "query", "type": "string"}, { "name": "category_id", "in": "path", "required": True, "type": "string", }, openapi._field2parameter( field=fields.List( fields.Str(), validate=validate.OneOf(["freddie", "roger"]), ), location="query", name="body", ), ] + openapi.schema2parameters(PageSchema, location="query"), "responses": {200: {"schema": PetSchema, "description": "A pet"}}, }, "post": { "parameters": ( [ { "name": "category_id", "in": "path", "required": True, "type": "string", } ] + openapi.schema2parameters(CategorySchema, location="body") ), "responses": {201: {"schema": PetSchema, "description": "A pet"}}, }, }, ) try: > utils.validate_spec(spec) tests/test_ext_marshmallow_openapi.py:521: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ spec = def validate_spec(spec): """Validate the output of an :class:`APISpec` object against the OpenAPI specification. Note: Requires installing apispec with the ``[validation]`` extras. :: pip install 'apispec[validation]' :raise: apispec.exceptions.OpenAPIError if validation fails. """ try: import prance except ImportError as error: # re-raise with a more verbose message exc_class = type(error) > raise exc_class( "validate_spec requires prance to be installed. " "You can install all validation requirements using:\n" " pip install 'apispec[validation]'" ) E ModuleNotFoundError: validate_spec requires prance to be installed. You can install all validation requirements using: E pip install 'apispec[validation]' src/apispec/utils.py:61: ModuleNotFoundError ________________________ test_openapi_tools_validate_v3 ________________________ spec = def validate_spec(spec): """Validate the output of an :class:`APISpec` object against the OpenAPI specification. Note: Requires installing apispec with the ``[validation]`` extras. :: pip install 'apispec[validation]' :raise: apispec.exceptions.OpenAPIError if validation fails. """ try: > import prance E ModuleNotFoundError: No module named 'prance' src/apispec/utils.py:58: ModuleNotFoundError During handling of the above exception, another exception occurred: def test_openapi_tools_validate_v3(): ma_plugin = MarshmallowPlugin() spec = APISpec( title="Pets", version="0.1", plugins=(ma_plugin,), openapi_version="3.0.0" ) openapi = ma_plugin.converter spec.components.schema("Category", schema=CategorySchema) spec.components.schema("Pet", schema=PetSchema) spec.path( view=None, path="/category/{category_id}", operations={ "get": { "parameters": [ {"name": "q", "in": "query", "schema": {"type": "string"}}, { "name": "category_id", "in": "path", "required": True, "schema": {"type": "string"}, }, openapi._field2parameter( field=fields.List( fields.Str(), validate=validate.OneOf(["freddie", "roger"]), ), location="query", name="body", ), ] + openapi.schema2parameters(PageSchema, location="query"), "responses": { 200: { "description": "success", "content": {"application/json": {"schema": PetSchema}}, } }, }, "post": { "parameters": ( [ { "name": "category_id", "in": "path", "required": True, "schema": {"type": "string"}, } ] ), "requestBody": { "content": {"application/json": {"schema": CategorySchema}} }, "responses": { 201: { "description": "created", "content": {"application/json": {"schema": PetSchema}}, } }, }, }, ) try: > utils.validate_spec(spec) tests/test_ext_marshmallow_openapi.py:590: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ spec = def validate_spec(spec): """Validate the output of an :class:`APISpec` object against the OpenAPI specification. Note: Requires installing apispec with the ``[validation]`` extras. :: pip install 'apispec[validation]' :raise: apispec.exceptions.OpenAPIError if validation fails. """ try: import prance except ImportError as error: # re-raise with a more verbose message exc_class = type(error) > raise exc_class( "validate_spec requires prance to be installed. " "You can install all validation requirements using:\n" " pip install 'apispec[validation]'" ) E ModuleNotFoundError: validate_spec requires prance to be installed. You can install all validation requirements using: E pip install 'apispec[validation]' src/apispec/utils.py:61: ModuleNotFoundError =========================== short test summary info ============================ FAILED tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2 FAILED tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3 ======================== 2 failed, 516 passed in 10.44s ======================== ==> ERROR: A failure occurred in check().  Aborting...