pytest_experiments.common module

Package tools common across modules.

class DocumentedEnum(value)[source]

Bases: enum.Enum

An enum base class than enables docstrings for members.

See https://stackoverflow.com/a/50473952

class ExperimentOutcome(value)[source]

Bases: pytest_experiments.common.DocumentedEnum

An enum for the experiment outcome.

pytest reports are generated for each phase: setup, call, teardown. The experiment outcome reflects a single outcome from the three phases.

error = 4
failed = 2
not_reported = 5
passed = 1
skipped = 3
exception PytestExperimentsError[source]

Bases: Exception

Base class for package exceptions.

class PytestOutcome(value)[source]

Bases: pytest_experiments.common.DocumentedEnum

An enum for the pytest report outcomes.

These are the possible values that TestReport.outcome may take.

failed = 2
passed = 1
skipped = 3
class PytestReportPhase(value)[source]

Bases: pytest_experiments.common.DocumentedEnum

An enum for pytest report phases.

These are the possible values that TestReport.when may take.

call = 2
setup = 1
teardown = 3
any_are_none(*args)[source]

Return True if any of args are None.

mark_utc(timestamp: datetime.datetime) datetime.datetime[source]

Mark a UTC timestamp with the UTC timezone.

This function should only be used when timestamp is already in UTC, but not labeled as such.

type_name_of(obj: Any) str[source]

Return the name of the input’s type.