Skip to content

Navigation Menu

Sign in
Sign up
This repository was archived by the owner on Aug 19, 2026. It is now read-only.

Repository files navigation

PyFixtures

Pytest style fixtures outside of Pytest.

import asyncio
from pathlib import Path
from pyfixtures import fixture, FixtureScope
@fixture
def tmpdir() -> path:
 path = Path("temp")
 path.mkdir()
 try:
 yield path
 finally:
 path.unlink()
def mk_temp_files(tmpdir: Path):
 tmp_file = tmpdir/"tempfile.txt"
 tmp_file.touch()
async def main():
 async with FixtureScope() as scope:
 operation = await scope.bind(mk_temp_files)
 await operation()
asyncio.run(main())

About

Pytest style fixtures outside of Pytest

Topics

Resources

Contributing

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /