Browse Source
Make pytest ignore py312 files for older py
pull/13920/head
lokidev
1 year ago
committed by
Albin Skott
Failed to extract signature
2 changed files with
6 additions and
1 deletions
-
tests/conftest.py
-
tests/test_dependency_pep695_py312.py
|
|
@ -0,0 +1,4 @@ |
|
|
|
import sys |
|
|
|
|
|
|
|
if sys.version_info < (3, 12): |
|
|
|
collect_ignore_glob = ["*_py312.py"] |
|
|
@ -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) |