Browse Source

Merge branch 'master' into zizmor-improvements

pull/15607/head
Yurii Motov 1 week ago
committed by GitHub
parent
commit
81942e6074
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      docs/en/docs/release-notes.md
  2. 20
      scripts/tests/test_translation_fixer/conftest.py

1
docs/en/docs/release-notes.md

@ -15,6 +15,7 @@ hide:
### Internal
* ✅ Use custom `changing_dir` instead of `CLIRunner.isolated_filesystem` to set working dir. PR [#15616](https://github.com/fastapi/fastapi/pull/15616) by [@YuriiMotov](https://github.com/YuriiMotov).
* ✅ Add `httpx2` test dependency to avoid deprecation warning. PR [#15603](https://github.com/fastapi/fastapi/pull/15603) by [@YuriiMotov](https://github.com/YuriiMotov).
* ⬆ Bump the python-packages group with 15 updates. PR [#15594](https://github.com/fastapi/fastapi/pull/15594) by [@dependabot[bot]](https://github.com/apps/dependabot).
* 👷 Configure Dependabot to group updates and update weekly. PR [#15560](https://github.com/fastapi/fastapi/pull/15560) by [@YuriiMotov](https://github.com/YuriiMotov).

20
scripts/tests/test_translation_fixer/conftest.py

@ -1,5 +1,8 @@
import os
import shutil
import sys
from collections.abc import Generator
from contextlib import contextmanager
from pathlib import Path
import pytest
@ -23,11 +26,20 @@ def pytest_collection_modifyitems(config, items: list[pytest.Item]) -> None:
item.add_marker(skip_on_windows)
@contextmanager
def changing_dir(directory: str | Path) -> Generator[None, None, None]:
initial_dir = os.getcwd()
os.chdir(directory)
try:
yield
finally:
os.chdir(initial_dir)
@pytest.fixture(name="runner")
def get_runner():
runner = CliRunner()
with runner.isolated_filesystem():
yield runner
def get_runner(tmp_path: Path):
with changing_dir(tmp_path):
yield CliRunner()
@pytest.fixture(name="root_dir")

Loading…
Cancel
Save