MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / writeTempPython

Function writeTempPython

test/python/python.integration.test.ts:23–31  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

21 });
22
23 function writeTempPython(content: string): string {
24 const tempFile = path.join(
25 os.tmpdir(),
26 `test-provider-${Date.now()}-${Math.random().toString(16).slice(2)}.py`,
27 );
28 fs.writeFileSync(tempFile, content);
29 tempFiles.push(tempFile);
30 return tempFile;
31 }
32
33 it('should handle heavy imports efficiently (load once)', async () => {
34 const scriptPath = writeTempPython(`

Callers 1

Calls 2

pushMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…