Home / File/ test_tutorial011.py — fastapi Source File

test_tutorial011.py — fastapi Source File

Architecture documentation for test_tutorial011.py, a python file in the fastapi codebase. 4 imports, 0 dependents.

File python FastAPI Routing 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  0a808897_f38e_f136_3f62_9f9ad8a99999["test_tutorial011.py"]
  498db554_9e30_154f_dda1_162f24e2873b["utils"]
  0a808897_f38e_f136_3f62_9f9ad8a99999 --> 498db554_9e30_154f_dda1_162f24e2873b
  238ca8dc_67ac_a93a_ec78_fc27ec421619["runpy"]
  0a808897_f38e_f136_3f62_9f9ad8a99999 --> 238ca8dc_67ac_a93a_ec78_fc27ec421619
  d1bf66df_8a92_7a7c_dab4_0865060effa4["unittest.mock"]
  0a808897_f38e_f136_3f62_9f9ad8a99999 --> d1bf66df_8a92_7a7c_dab4_0865060effa4
  5befe8bf_65d1_d058_6b78_4a597a8488e9["pytest"]
  0a808897_f38e_f136_3f62_9f9ad8a99999 --> 5befe8bf_65d1_d058_6b78_4a597a8488e9
  style 0a808897_f38e_f136_3f62_9f9ad8a99999 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import runpy
from unittest.mock import patch

import pytest

from ...utils import needs_py310


@pytest.mark.parametrize(
    "module_name",
    [
        pytest.param("tutorial011_py39"),
        pytest.param("tutorial011_py310", marks=needs_py310),
    ],
)
def test_run_module(module_name: str):
    with patch("builtins.print") as mock_print:
        runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__")

    assert mock_print.call_count == 2
    call_args = [str(arg.args[0]) for arg in mock_print.call_args_list]
    assert call_args == [
        "id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]",
        "123",
    ]

Domain

Subdomains

Functions

Dependencies

  • pytest
  • runpy
  • unittest.mock
  • utils

Frequently Asked Questions

What does test_tutorial011.py do?
test_tutorial011.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Routing subdomain.
What functions are defined in test_tutorial011.py?
test_tutorial011.py defines 1 function(s): test_run_module.
What does test_tutorial011.py depend on?
test_tutorial011.py imports 4 module(s): pytest, runpy, unittest.mock, utils.
Where is test_tutorial011.py in the architecture?
test_tutorial011.py is located at tests/test_tutorial/test_python_types/test_tutorial011.py (domain: FastAPI, subdomain: Routing, directory: tests/test_tutorial/test_python_types).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free