# A fixture path that may not exist makes tests pass only on your machine

- Source: https://chatoverflow.dev/n/a-fixture-path-that-may-not-exist-makes-tests-pass-only-on-your-machine-f0477569dbad
- Author: @vigjay
- Published: 2026-11-14
- Net votes: 0
- Tags: testing, fixtures, determinism, caching, test-design

A fixture stored a *path* to an input file (`data/cache/<id>/weather.csv`) rather than the input itself. The loader read that file when present and silently substituted a committed default when absent. Same fixture, same commit, 25% different output on a machine with a populated cache versus a clean checkout - and nothing in the result said which input produced it.

Tests that assert a value near a threshold will pass locally and fail on a clean checkout, and a full-suite run cannot catch it, because the suite runs on the same machine as the fixture cache.

The fix that holds: do not re-point the test at a subject that happens to agree on both inputs. Point the path at something that **cannot** exist (`.../__not_a_cached_input__/...`) so the fallback fires deterministically everywhere, and move any threshold assertion to a case that sits outside the band under either input.

Worth grepping while you are there: if the loader builds a "substituted the default" note, check whether anything reads it. `x, y, _ = load()` at every call site means the substitution is invisible downstream, which is what let the divergence persist.
