﻿# How can pytest skips hide an unsupported benchmark slice?

A practical investigation of how can pytest skips hide an unsupported benchmark slice?, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-bench-pytest-skipped-benchmark-coverage/
Language: en

## The comparison being tested

A benchmark suite reports success after an environment upgrade, but an optional backend dependency no longer imports. Tests for that backend are skipped, leaving a green result from the remaining cases. The run did not establish that the unsupported slice works. It established outcomes for a reduced executed population, which must remain distinct from the intended model, shape and precision matrix.

## The confounding mechanism

Pytest documents skipif, module-level skips and importorskip as legitimate ways to avoid tests that cannot run. Missing imports can therefore produce skip outcomes rather than failing executed tests. Entire files can also be excluded from collection. A terminal success indicator alone cannot tell a reader whether the expected experiment cells were collected, skipped, failed during setup or actually measured.

## Fix the experimental contract

Define an expected manifest of benchmark cells independently from test discovery. Associate each cell with required dependencies, support policy and an execution identity. Decide whether unsupported cases block a release or remain declared omissions. Preserve expected failures separately from skips and passes. The policy should reflect the actual claim; a portability claim across backends requires different coverage from a single-supported-backend smoke check.

## A step-by-step comparison

First compare collected identifiers with the expected manifest. Next record setup, execution and final outcome for each collected cell. Enable reporting that includes skip reasons and preserve the machine-readable results used by the audit. Introduce a missing optional dependency in an isolated fixture: the coverage report should show the affected slice as unexecuted rather than carrying forward an earlier successful measurement.

## Evidence required for the result

The evidence needs expected, collected, executed, skipped and failed populations with reasons, versions and configuration. Keep historical measurements under their own run identities. A control removes an entire test module from collection, verifying that the expected-manifest reconciliation still detects absence. Acceptance means the stated coverage is supported by executed observations or explicitly bounded omissions, not merely an absence of failing assertions.

## Interpretation and limits

Skipping unsupported combinations can be correct and avoids misleading crashes masquerading as model failures. The mistake is converting that correct skip into positive capability evidence. A suite can pass under its rules while failing to answer a broader benchmark question. This proposed audit does not run tests or establish hardware support; it preserves the denominator required to interpret the reported session.

## Primary references and related reading

A passing test session needs an explicit executed-workload denominator before it supports benchmark coverage. [pytest skip and expected-failure semantics](https://docs.pytest.org/en/stable/how-to/skipping.html); [pytest outcome reporting](https://docs.pytest.org/en/stable/how-to/output.html).

The proposed investigation of pytest skipped benchmark coverage is not an executed deployment benchmark. Related reading: [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/); [Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/).
