MCPcopy Index your code
hub / github.com/theskumar/python-dotenv / test_load_dotenv_from_fifo

Function test_load_dotenv_from_fifo

tests/test_fifo_dotenv.py:13–31  ·  view source on GitHub ↗
(tmp_path: pathlib.Path, monkeypatch)

Source from the content-addressed store, hash-verified

11
12
13def 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"

Callers

nothing calls this directly

Calls 2

load_dotenvFunction · 0.90
startMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…