Setup motion tracking scene (Movie Clip editor) from commandline

I’ve been trying to set up a scene for motion tracking using a python script from command line.

My code involves simple.blend file, which is a pre-saved blank scene with default motion tracking workspace, and script. I run this from the cli as: blender simple.blend --python

The sequence is successfully loaded and then I need to link this sequence to MovieClip and prepare clip editor for tracking. But in UI I still see nothing has changed (I can only see in dropdown menu imported jpeg sequence)

My code ( to setup MovieClip for motion tracking: # load a sequence file

for area in bpy.context.screen.areas:
    if area.type == 'CLIP_EDITOR':
        override = bpy.context.copy()
        override['space_data'] =
        override['region'] = area.regions[-1]
        override['area'] = area
        override['space_data'].clip =[0] 
        bpy.ops.clip.view_all(override, fit_view=True)  

After that script when I print out a value of space_data.clip I get a correct value of movieclips[0] (jpeg sequence imported after startup). Could someone please point out to me what I’m doing wrong ?