Dagger
Search

pytest

No long description provided.

Installation

dagger install github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae

Entrypoint

Return Type
Pytest !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
sourcePathString -No description provided
args[String ! ] -No description provided
pythonVersionString -No description provided
containerContainer -No description provided
runnerEnum -No description provided
installDepsBoolean -No description provided
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
func (m *MyModule) Example() *dagger.Pytest  {
	return dag.
			Pytest()
}
@function
def example() -> dagger.Pytest:
	return (
		dag.pytest()
	)
@func()
example(): Pytest {
	return dag
		.pytest()
}

Types

Pytest 🔗

source() 🔗

The source directory containing your Python project, taken from the workspace at sourcePath in the constructor.

Return Type
Directory !
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 source
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Pytest().
			Source()
}
@function
def example() -> dagger.Directory:
	return (
		dag.pytest()
		.source()
	)
@func()
example(): Directory {
	return dag
		.pytest()
		.source()
}

args() 🔗

Additional arguments to pass to pytest (e.g., [“-x”, “–tb=short”])

Return Type
[String ! ] !
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 args
func (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Pytest().
			Args(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.pytest()
		.args()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.pytest()
		.args()
}

pythonVersion() 🔗

Optional: Python version to use (e.g., “3.14”, “3.13”, “3.12”)

Only relevant when using the default base.

Return Type
String !
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 python-version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Pytest().
			PythonVersion(ctx)
}
@function
async def example() -> str:
	return await (
		dag.pytest()
		.python_version()
	)
@func()
async example(): Promise<string> {
	return dag
		.pytest()
		.pythonVersion()
}

container() 🔗

Optional: a custom image that replaces the default Alpine+uv base. When set, Python provisioning (uv venv) is skipped.

Return Type
Container 
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Pytest().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.pytest()
		.container()
	)
@func()
example(): Container {
	return dag
		.pytest()
		.container()
}

runner() 🔗

Which Python tool to use. AUTO probes the container (prefers uv, else pip).

Return Type
Enum 
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 runner
func (m *MyModule) Example()   {
	return dag.
			Pytest().
			Runner()
}
@function
def example() -> :
	return (
		dag.pytest()
		.runner()
	)
@func()
example():  {
	return dag
		.pytest()
		.runner()
}

installDeps() 🔗

Whether test installs project dependencies before running. Set false when the container already has them baked in.

Return Type
Boolean !
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 install-deps
func (m *MyModule) Example(ctx context.Context) bool  {
	return dag.
			Pytest().
			InstallDeps(ctx)
}
@function
async def example() -> bool:
	return await (
		dag.pytest()
		.install_deps()
	)
@func()
async example(): Promise<boolean> {
	return dag
		.pytest()
		.installDeps()
}

test() 🔗

Test a Python project with pytest and OpenTelemetry tracing.

Builds a container from the base (custom or default), adds your source, optionally installs dependencies, then dispatches to the uv or pip run path (auto-detected unless runner is set explicitly).

Return Type
Void !
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 test
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Pytest().
			Test(ctx)
}
@function
async def example() -> None:
	return await (
		dag.pytest()
		.test()
	)
@func()
async example(): Promise<void> {
	return dag
		.pytest()
		.test()
}

testUv() 🔗

Run pytest with uv on a container that already has source + deps. Installs pytest_otel (forced uv), then uv run pytest. Returns the post-run container.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-No description provided
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 test-uv --ctr IMAGE:TAG
func (m *MyModule) Example(ctr *dagger.Container) *dagger.Container  {
	return dag.
			Pytest().
			TestUv(ctr)
}
@function
def example(ctr: dagger.Container) -> dagger.Container:
	return (
		dag.pytest()
		.test_uv(ctr)
	)
@func()
example(ctr: Container): Container {
	return dag
		.pytest()
		.testUv(ctr)
}

testPip() 🔗

Run pytest with pip on a container that already has source + deps. Installs pytest_otel (forced pip), then python -m pytest. Returns the post-run container.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-No description provided
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 test-pip --ctr IMAGE:TAG
func (m *MyModule) Example(ctr *dagger.Container) *dagger.Container  {
	return dag.
			Pytest().
			TestPip(ctr)
}
@function
def example(ctr: dagger.Container) -> dagger.Container:
	return (
		dag.pytest()
		.test_pip(ctr)
	)
@func()
example(ctr: Container): Container {
	return dag
		.pytest()
		.testPip(ctr)
}

installPytestOtel() 🔗

Install pytest_otel into a container you manage yourself.

runner AUTO detects the tool at runtime (uv -> pip -> python -m pip); UV or PIP forces that tool even when others are present. Returns the container with pytest_otel installed; run pytest yourself on it.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-No description provided
runnerEnum -No description provided
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 install-pytest-otel --ctr IMAGE:TAG
func (m *MyModule) Example(ctr *dagger.Container) *dagger.Container  {
	return dag.
			Pytest().
			InstallPytestOtel(ctr)
}
@function
def example(ctr: dagger.Container) -> dagger.Container:
	return (
		dag.pytest()
		.install_pytest_otel(ctr)
	)
@func()
example(ctr: Container): Container {
	return dag
		.pytest()
		.installPytestOtel(ctr)
}

pytestOtel() 🔗

The bundled pytest_otel library, as a Directory, for fully-manual integration (the package is not yet published to PyPI).

Return Type
Directory !
Example
dagger -m github.com/eunomie/pytest@82018060f8db6f04efc5ea99c5421c0597e715ae call \
 pytest-otel
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Pytest().
			PytestOtel()
}
@function
def example() -> dagger.Directory:
	return (
		dag.pytest()
		.pytest_otel()
	)
@func()
example(): Directory {
	return dag
		.pytest()
		.pytestOtel()
}