V0.3.0 stage2 autoregressive #27
+14
-3
@@ -98,10 +98,21 @@ def test_render_router_diagnostics_and_edge_cases(tmp_path: Path):
|
||||
|
||||
|
||||
def test_render_all_run_gallery_invokes_subprocess(tmp_path: Path, monkeypatch):
|
||||
# render_mod.subprocess *is* the stdlib subprocess module, so a blanket
|
||||
# patch of .run would also swallow the real subprocess.run calls
|
||||
# matplotlib's texmanager makes to compile LaTeX during savefig — only
|
||||
# intercept the "gallery generate" call itself and pass everything else
|
||||
# (LaTeX included) through to the real subprocess.run.
|
||||
calls = []
|
||||
monkeypatch.setattr(
|
||||
render_mod.subprocess, "run", lambda *a, **k: calls.append((a, k))
|
||||
)
|
||||
real_run = render_mod.subprocess.run
|
||||
|
||||
def fake_run(*a, **k):
|
||||
if a and a[0] and a[0][0] == "gallery":
|
||||
calls.append((a, k))
|
||||
return None
|
||||
return real_run(*a, **k)
|
||||
|
||||
monkeypatch.setattr(render_mod.subprocess, "run", fake_run)
|
||||
reduced = [
|
||||
Reduced(
|
||||
"s",
|
||||
|
||||
Reference in New Issue
Block a user