We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 157f60c commit c7b4302Copy full SHA for c7b4302
tests/conftest.py
@@ -54,11 +54,10 @@ def image_file(
54
) -> Generator[io.BufferedRandom, None, None]:
55
"""An image file object."""
56
file = tmp_path / "image.jpg"
57
- file.touch()
58
- with file.open("r+b") as fileobj:
59
- buffer = high_quality_image.getvalue()
60
- fileobj.write(buffer)
61
- yield fileobj
+ buffer = high_quality_image.getvalue()
+ file.write_bytes(data=buffer)
+ with file.open("r+b") as file_obj:
+ yield file_obj
62
63
64
@pytest.fixture(params=["high_quality_image", "image_file"])
0 commit comments