1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
package python import ( "context" "testing" ) func TestRun(t *testing.T) { var code = `import sys print(f"Python {sys.version} running in {sys.platform}/wazero.")` dir := t.TempDir() res, err := Run(context.Background(), dir, code) if err != nil { t.Fatal(err) } t.Logf("stdout: %s", res.Stdout) t.Logf("stderr: %s", res.Stderr) }