Skip to content

Not clear how to import image_diff #10

@mccalluc

Description

@mccalluc

Sorry if I'm missing something, but where are image_diff and image_regression defined or imported in this example?

from typing import Union
from PIL import Image


def test_compare(image_diff):
    image: Image or str or bytes = Image.new()
    image2: Image or str or bytes = '/path/to/image.jpeg'
    image_diff(image, image2)


def test_regression(image_regression):
    image: Union[Image, str, bytes] = Image.new()
    image_regression(image, threshold=0.5)

Depending on how I import and use it I can get this error:

Fixture "image_diff" called directly. Fixtures are not meant to be called directly,
but are created automatically when test functions request them as parameters.

or

TypeError: 'module' object is not callable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions