From ec6014ab3f53d9ba25e740aff314f69c4a357c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Kr=C3=BCger=20Svensson?= Date: Thu, 10 Nov 2022 15:22:05 +0100 Subject: [PATCH] tests: only run schema tests on < 0.86.0 --- .github/workflows/testing.yaml | 4 ++-- tests/test_openapi_scheme.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 4d3f311..1f4113a 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -27,8 +27,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.8.15", "3.9.15", "3.10.8", "3.11.0" ] - fastapi-version: [ "0.68.0", "0.70.0", "0.71.0" ] + python-version: [ "3.8.13", "3.9.15", "3.10.8", "3.11.0" ] + fastapi-version: [ "0.68.0", "0.70.0", "0.71.0", "0.86.0"] steps: - name: Check out repository uses: actions/checkout@v3 diff --git a/tests/test_openapi_scheme.py b/tests/test_openapi_scheme.py index 5906782..11e5561 100644 --- a/tests/test_openapi_scheme.py +++ b/tests/test_openapi_scheme.py @@ -1,3 +1,4 @@ +import fastapi import pytest from demo_project.main import app from fastapi.testclient import TestClient @@ -203,6 +204,7 @@ def test_client(): yield TestClient(app=app) +@pytest.mark.skipif(fastapi.__version__ < ('0.86.0'), reason='Different schema in older version') def test_openapi_schema(test_client): response = test_client.get('api/v1/openapi.json') assert response.status_code == 200, response.text