conftest.py — fastapi Source File
Architecture documentation for conftest.py, a python file in the fastapi codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR c3c69c60_8be1_6066_1beb_350569799fde["conftest.py"] 879863b9_0db7_67c9_55cb_81a43a46d5ca["shutil"] c3c69c60_8be1_6066_1beb_350569799fde --> 879863b9_0db7_67c9_55cb_81a43a46d5ca 65099b90_26c1_5db5_09e6_30dc0ea421e3["sys"] c3c69c60_8be1_6066_1beb_350569799fde --> 65099b90_26c1_5db5_09e6_30dc0ea421e3 b3e303a2_3f2d_638d_930c_3a5dcc2f5a42["pathlib"] c3c69c60_8be1_6066_1beb_350569799fde --> b3e303a2_3f2d_638d_930c_3a5dcc2f5a42 5befe8bf_65d1_d058_6b78_4a597a8488e9["pytest"] c3c69c60_8be1_6066_1beb_350569799fde --> 5befe8bf_65d1_d058_6b78_4a597a8488e9 50e86d72_8593_e02d_8fa4_63659153e8bf["typer.testing"] c3c69c60_8be1_6066_1beb_350569799fde --> 50e86d72_8593_e02d_8fa4_63659153e8bf style c3c69c60_8be1_6066_1beb_350569799fde fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import shutil
import sys
from pathlib import Path
import pytest
from typer.testing import CliRunner
skip_on_windows = pytest.mark.skipif(
sys.platform == "win32", reason="Skipping on Windows"
)
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
for item in items:
item.add_marker(skip_on_windows)
@pytest.fixture(name="runner")
def get_runner():
runner = CliRunner()
with runner.isolated_filesystem():
yield runner
@pytest.fixture(name="root_dir")
def prepare_paths(runner):
docs_dir = Path("docs")
en_docs_dir = docs_dir / "en" / "docs"
lang_docs_dir = docs_dir / "lang" / "docs"
en_docs_dir.mkdir(parents=True, exist_ok=True)
lang_docs_dir.mkdir(parents=True, exist_ok=True)
yield Path.cwd()
@pytest.fixture
def copy_test_files(root_dir: Path, request: pytest.FixtureRequest):
en_file_path = Path(request.param[0])
translation_file_path = Path(request.param[1])
shutil.copy(str(en_file_path), str(root_dir / "docs" / "en" / "docs" / "doc.md"))
shutil.copy(
str(translation_file_path), str(root_dir / "docs" / "lang" / "docs" / "doc.md")
)
Domain
Subdomains
Dependencies
- pathlib
- pytest
- shutil
- sys
- typer.testing
Source
Frequently Asked Questions
What does conftest.py do?
conftest.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Applications subdomain.
What functions are defined in conftest.py?
conftest.py defines 4 function(s): copy_test_files, get_runner, prepare_paths, pytest_collection_modifyitems.
What does conftest.py depend on?
conftest.py imports 5 module(s): pathlib, pytest, shutil, sys, typer.testing.
Where is conftest.py in the architecture?
conftest.py is located at scripts/tests/test_translation_fixer/conftest.py (domain: FastAPI, subdomain: Applications, directory: scripts/tests/test_translation_fixer).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free