"""Module for a base asteex executor."""

from abc import ABC, abstractmethod


class ExecutionError(Exception):
    """Exception class for errors raised during the execution."""


class Executor(ABC):
    """Class for a base executor."""

    @abstractmethod
    def execute(self, instances):
        """Execute test instances.

        :param instances:
            async iterable with :class:`Instances <asteex.abstract.instance.Instance>`.
        :returns: async iterable with :class:`Results <asteex.abstract.result.Result>`.
        :raises: :class:`ExecutionError`.
        """

    def __repr__(self):
        class_name = self.__class__.__name__

        return f"{class_name}()"
