(tmp_path: pathlib.Path, monkeypatch)
| 11 | |
| 12 | |
| 13 | def test_load_dotenv_from_fifo(tmp_path: pathlib.Path, monkeypatch): |
| 14 | fifo = tmp_path / ".env" |
| 15 | os.mkfifo(fifo) # create named pipe |
| 16 | |
| 17 | def writer(): |
| 18 | with open(fifo, "w", encoding="utf-8") as w: |
| 19 | w.write("MY_PASSWORD=pipe-secret\n") |
| 20 | |
| 21 | t = threading.Thread(target=writer) |
| 22 | t.start() |
| 23 | |
| 24 | # Ensure env is clean |
| 25 | monkeypatch.delenv("MY_PASSWORD", raising=False) |
| 26 | |
| 27 | ok = load_dotenv(dotenv_path=str(fifo), override=True) |
| 28 | t.join(timeout=2) |
| 29 | |
| 30 | assert ok is True |
| 31 | assert os.getenv("MY_PASSWORD") == "pipe-secret" |
nothing calls this directly
no test coverage detected
searching dependent graphs…