import bpy, os, tempfile

out = os.path.join(tempfile.gettempdir(), 'check_render4.png')
bpy.context.scene.render.filepath = out
bpy.ops.render.render(write_still=True)
print('rendered', out, os.path.getsize(out))