Skip to main content

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

Metadata

Release files for pyfixtures 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfixtures 1.1.0
File Size Uploaded
pyfixtures-1.1.0.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfixtures 1.1.0
File Interpreter ABI Platform
pyfixtures-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / pyfixtures-1.1.0.tar.gz

Download URL pyfixtures-1.1.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
58700c1abef58df4f520a2fc2099541971199e3fb707965f64b48adc442b9bba
BLAKE2b-256 checksum
How to use checksums
927c66ff347ebce9eea833fc2c17a49e2614c90eff5e27e7a1662d060d7239a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.13 Linux/5.13.0-1025-azure

Release files / pyfixtures-1.1.0-py3-none-any.whl

Download URL pyfixtures-1.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bec76935532d9d98fa1c3f9f42175f915b0f8c8b12d3f08313a57c73c5116b0b
BLAKE2b-256 checksum
How to use checksums
50b7db6cf5e90a3c9ea6247f76617d7be9e21651ef93abc8bee2b82c85b3b073
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.13 Linux/5.13.0-1025-azure

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page