File: test_tutorial003_04.py

package info (click to toggle)
fastapi 0.118.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,212 kB
  • sloc: python: 69,848; javascript: 369; sh: 18; makefile: 17
file content (18 lines) | stat: -rw-r--r-- 434 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import importlib

import pytest
from fastapi.exceptions import FastAPIError

from ...utils import needs_py310


@pytest.mark.parametrize(
    "module_name",
    [
        "tutorial003_04",
        pytest.param("tutorial003_04_py310", marks=needs_py310),
    ],
)
def test_invalid_response_model(module_name: str) -> None:
    with pytest.raises(FastAPIError):
        importlib.import_module(f"docs_src.response_model.{module_name}")