diff --git a/tests/test_update_shape_pin_source.py b/tests/test_update_shape_pin_source.py index 3b29edb9..8dbc229b 100644 --- a/tests/test_update_shape_pin_source.py +++ b/tests/test_update_shape_pin_source.py @@ -431,6 +431,16 @@ def opening(spec, *_pin_path): return real(str(upstream_and_project["upstream"])) monkeypatch.setattr(update_shape, "open_upstream", opening) + # THIS PROCESS READS `LANES_LANE`, THE CHILD READS A BLANK (#1299). + # `update_shape.main` prints its NEXT through `lane_trailer_argument`, + # which reads this process's environment. This module's `run` goes + # through `conftest.run_script`, which blanks the child's lane. In a + # shell that exports one, only the in-process NEXT ended + # `--trailer 'Lane: '`, and the two answers differed by that + # alone. Unset is no lane, as the blank is: the two read the same. With + # the guard in place the child gets no lane even without that blank, + # because `run_script` copies `os.environ` after the guard has run. + monkeypatch.delenv("LANES_LANE", raising=False) code = update_shape.main(["check", "--root", str(root)]) out = capsys.readouterr().out passed = run(root, "check", *upstream_of(upstream_and_project))