MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_nested_frozen

Function test_nested_frozen

crates/vm/src/vm/mod.rs:2281–2303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2279
2280#[test]
2281fn test_nested_frozen() {
2282 use rustpython_vm as vm;
2283
2284 vm::Interpreter::builder(Default::default())
2285 .add_frozen_modules(rustpython_vm::py_freeze!(
2286 dir = "../../../../extra_tests/snippets"
2287 ))
2288 .build()
2289 .enter(|vm| {
2290 let scope = vm.new_scope_with_builtins();
2291
2292 let source = "from dir_module.dir_module_inner import value2";
2293 let code_obj = vm
2294 .compile(source, vm::compiler::Mode::Exec, "<embedded>".to_owned())
2295 .map_err(|err| vm.new_syntax_error(&err, Some(source)))
2296 .unwrap();
2297
2298 if let Err(e) = vm.run_code_obj(code_obj, scope) {
2299 vm.print_exception(e);
2300 panic!();
2301 }
2302 })
2303}
2304
2305#[test]
2306fn frozen_origname_matches() {

Callers

nothing calls this directly

Calls 11

add_frozen_modulesMethod · 0.80
new_syntax_errorMethod · 0.80
run_code_objMethod · 0.80
print_exceptionMethod · 0.80
SomeClass · 0.50
enterMethod · 0.45
buildMethod · 0.45
unwrapMethod · 0.45
compileMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected