Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VIRTS-3044] Silence Schema Warnings #2333

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import sys
import warnings

import aiohttp_apispec
from aiohttp_apispec import validation_middleware
Expand Down Expand Up @@ -77,6 +78,10 @@ def init_swagger_documentation(app):
"""Makes swagger documentation available at /api/docs for any endpoints
marked for aiohttp_apispec documentation.
"""
warnings.filterwarnings(
"ignore",
message="Multiple schemas resolved to the name"
)
aiohttp_apispec.setup_aiohttp_apispec(
app=app,
title='CALDERA',
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import uuid
import yaml
import aiohttp_apispec
import warnings

from unittest import mock
from aiohttp_apispec import validation_middleware
Expand Down Expand Up @@ -315,6 +316,11 @@ def agent_config():
@pytest.fixture
def api_v2_client(loop, aiohttp_client, contact_svc):
def make_app(svcs):
warnings.filterwarnings(
"ignore",
message="Multiple schemas resolved to the name"
)

app = web.Application(
middlewares=[
authentication_required_middleware_factory(svcs['auth_svc']),
Expand Down