cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.11k stars 290 forks source link

Run test imports at top level, fix pydantic and numpy imports #2324

Closed garrettgu10 closed 3 months ago

garrettgu10 commented 3 months ago

Importing stuff within a test() function does not invoke the top-level entropy patches we implemented, so this change should make our testing much more complete.

Should reproduce https://github.com/cloudflare/python-workers-examples/issues/9.

garrettgu10 commented 3 months ago

@dom96 I've thought about it, but my take is that the process of importing at top level is basically a superset of importing not-at-top-level, so it's acceptable to only test top level imports.

Maybe @hoodmane has more thoughts?