Metadata-Version: 2.1
Name: pyfixtures
Version: 1.1.0
Summary: Pytest style fixtures outside of Pytest.
Home-page: https://github.com/virtool/fixtures
License: MIT
Author: Ian Boyes
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries
Project-URL: Repository, https://github.com/virtool/fixtures
Description-Content-Type: text/markdown

# PyFixtures

[Pytest](https://docs.pytest.org/en/7.1.x/) style [fixtures](https://docs.pytest.org/en/6.2.x/fixture.html) outside of Pytest.

```python
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())

```

