You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dump only module name + function name, and in the other process, it uses that information to obtain the function object and call it.
If the function object doesn't have a module attribute (which is the case with --import-mode=importlib), then it tries to pickle the actual function object, but then fails.
(I don't have time to look up the code, so I'm just assuming the above is true)
If that's the case, it is not something that is possible to fix: the importlib module's purpose is to not pollute the sys.modules dict with the test modules being imported.
@schperplata The python extension is not involved in this at all. If you do pickle.dumps on sleepSomeTimeInTestFile it does not match what it expects in the test process. Actual __main__.sleepSomeTimeInTestFile, pickle expects test_example.sleepSomeTimeInTestFile.
Closing this since it occurs without the python extension being involved.
Issue Type: Bug
Pytest raises:
... error when:
"--import-mode=importlib"
arg is usedProcess()
target=<function>
function is defined in the same (test) fileWithout
"--import-mode=importlib"
test works (but not when test files have the same names.pytestImporlibTest.zip
Extension version: 2020.8.105045
VS Code version: Code 1.48.2 (a0479759d6e9ea56afa657e454193f72aef85bd0, 2020-08-25T10:13:11.295Z)
OS version: Windows_NT x64 10.0.19041
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: