def test_import_relative(tmpdir, session):
    task_dir = tmpdir.mkdir("mytasks")
    task_dir.join("myfile.py").write(dedent("""
    from utils import value
    def main():
        assert value == 5
    """))

    task_dir.join("utils.py").write(dedent("""
    value = 5
    """))

    with tmpdir.as_cwd():

        task = FuncTask(
            func_name="main",
            path="mytasks/myfile.py",
            name="a task",
            execution="main",
            session=session
        )
        task()

        records = list(map(lambda e: e.dict(exclude={'created'}), session.get_task_log()))
        assert [
            {"task_name": "a task", "action": "run"},
            {"task_name": "a task", "action": "success"},
        ] == records
))

task_dir.join("utils.py").write(dedent(
rocketry/test/task/func/test_run_delayed.py