File tree Expand file tree Collapse file tree
tests/worker/workflow_sandbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import pathlib
4- import sys
54from dataclasses import dataclass
65from typing import ClassVar
76
1615)
1716
1817
19- def test_workflow_sandbox_stdlib_module_names ():
20- if sys .version_info [1 ] != 11 :
21- pytest .skip ("Test only runs on 3.11" )
22- actual_names = "," .join (sorted (sys .stdlib_module_names ))
23- # Uncomment to print code for generating these
24- code_lines = ["" ]
25- for mod_name in sorted (sys .stdlib_module_names ):
26- if code_lines [- 1 ]:
27- code_lines [- 1 ] += ","
28- if len (code_lines [- 1 ]) > 80 :
29- code_lines .append ("" )
30- code_lines [- 1 ] += mod_name
31- code = '_stdlib_module_names = (\n "' + '"\n "' .join (code_lines ) + '"\n )'
32- # TODO(cretz): Point releases may add modules :-(
33- assert actual_names == "," .join (
34- sys .stdlib_module_names
35- ), f"Expecting names as { actual_names } . In code as:\n { code } "
36-
37-
3818def test_workflow_sandbox_restrictions_add_passthrough_modules ():
3919 updated = SandboxRestrictions .default .with_passthrough_modules ("module1" , "module2" )
4020 assert (
You can’t perform that action at this time.
0 commit comments