Unwind async/await chains (#957)

*Cleanup several spots where runtime.run() no longer needs to be awaited, now that #928 is merged.
This commit is contained in:
Jeff Glass
2022-11-16 13:42:40 -06:00
committed by GitHub
parent 0b23310a06
commit 7e24289703
7 changed files with 22 additions and 24 deletions

View File

@@ -50,19 +50,19 @@ describe('PyodideRuntime', () => {
});
it('should check if runtime can run python code asynchronously', async () => {
expect(await runtime.run("2+3")).toBe(5);
expect(runtime.run("2+3")).toBe(5);
});
it('should capture stdout', async () => {
stdio.reset();
await runtime.run("print('hello')");
runtime.run("print('hello')");
expect(stdio.captured_stdout).toBe("hello\n");
});
it('should check if runtime is able to load a package', async () => {
await runtime.loadPackage("numpy");
await runtime.run("import numpy as np");
await runtime.run("x = np.ones((10,))");
runtime.run("import numpy as np");
runtime.run("x = np.ones((10,))");
expect(runtime.globals.get('x').toJs()).toBeInstanceOf(Float64Array);
});