Make pytest ignore py312 files for older py

This commit is contained in:
lokidev 2024-02-13 21:38:44 +01:00 committed by Albin Skott
parent 5d7dbf8b1a
commit 1dbb6048ca
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

4
tests/conftest.py Normal file
View File

@ -0,0 +1,4 @@
import sys
if sys.version_info < (3, 12):
collect_ignore_glob = ["*_py312.py"]

View File

@ -4,6 +4,7 @@ from typing import Annotated
from fastapi import Depends, FastAPI
from fastapi.testclient import TestClient
from .utils import needs_py312
@ -19,7 +20,7 @@ def test_pep695_type_dependencies():
app = FastAPI()
@app.get("/")
async def get_with_dep(value: DependedValue) -> str:
async def get_with_dep(value: DependedValue) -> str: # noqa
return f"value: {value}"
client = TestClient(app)