pytest
No long description provided.
Installation
dagger install github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972Entrypoint
Return Type
Pytest !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | No description provided |
| sourcePath | String | - | No description provided |
| args | [String ! ] | - | No description provided |
| pythonVersion | String | - | No description provided |
| container | Container | - | No description provided |
| runner | Enum | - | No description provided |
| installDeps | Boolean | - | No description provided |
Example
dagger -m github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972 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
sourcePathin the constructor.
Return Type
Directory ! Example
dagger -m github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
sourcefunc (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@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
argsfunc (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@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
python-versionfunc (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@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
containerfunc (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@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
runnerfunc (m *MyModule) Example() {
return dag.
Pytest().
Runner()
}@function
def example() -> :
return (
dag.pytest()
.runner()
)@func()
example(): {
return dag
.pytest()
.runner()
}installDeps() 🔗
Whether
testinstalls project dependencies before running. Set false when the container already has them baked in.
Return Type
Boolean ! Example
dagger -m github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
install-depsfunc (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@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
testfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ctr | Container ! | - | No description provided |
Example
dagger -m github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
test-uv --ctr IMAGE:TAGfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ctr | Container ! | - | No description provided |
Example
dagger -m github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
test-pip --ctr IMAGE:TAGfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ctr | Container ! | - | No description provided |
| runner | Enum | - | No description provided |
Example
dagger -m github.com/eunomie/pytest@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
install-pytest-otel --ctr IMAGE:TAGfunc (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@bf1bee61a09937c4d6928deb8c4536ecfd208972 call \
pytest-otelfunc (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()
}