def _expects_tests(jobplan):
    if _is_snapshot_job(jobplan):
        return False

    if 'snapshot' in jobplan.data:
        options = jobplan.data['snapshot']['options']
    else:
        options = dict(db.session.query(
            ItemOption.name, ItemOption.value,
        ).filter(
            ItemOption.item_id == jobplan.plan.id,
            ItemOption.name == 'build.expect-tests',
        ))

    return options.get('build.expect-tests') == '1'
Check whether a jobplan expects tests or not.
dataset/ETHPy150Open dropbox/changes/changes/jobs/sync_job_step.py/_expects_tests