conftest.py 597 B

1234567891011121314151617
  1. import os
  2. import pytest
  3. from PIL import Image
  4. from gradio.processing_utils import encode_pil_to_base64
  5. test_files_path = os.path.dirname(__file__) + "/test_files"
  6. @pytest.fixture(scope="session") # session so we don't read this over and over
  7. def img2img_basic_image_base64() -> str:
  8. return encode_pil_to_base64(Image.open(os.path.join(test_files_path, "img2img_basic.png")))
  9. @pytest.fixture(scope="session") # session so we don't read this over and over
  10. def mask_basic_image_base64() -> str:
  11. return encode_pil_to_base64(Image.open(os.path.join(test_files_path, "mask_basic.png")))