def METHOD_NAME(defer, worker):
    from .param import Param
    defer("sum_task", a=5, b=7)
    defer("sum_task_param", p1=Param(3), p2=Param(4))
    defer("increment_task", a=3)
    stdout, stderr = worker()
    print(stdout, stderr)
    assert stdout.splitlines() == ["Launching a worker on all queues", "12", "7", "4"]
    assert stderr.startswith("DEBUG:procrastinate.")
    defer("product_task", a=5, b=4)
    stdout, stderr = worker("default")
    print(stdout, stderr)
    assert "20" not in stdout
    stdout, stderr = worker("product_queue")
    print(stdout, stderr)
    assert stdout.splitlines() == ["Launching a worker on product_queue", "20"]
    defer("two_fails")
    stdout, stderr = worker()
    print(stdout, stderr)
    assert "Print something to stdout" in stdout
    assert stderr.count("Exception: This should fail") == 2
    defer("multiple_exception_failures")
    stdout, stderr = worker()
    print(stdout, stderr)
    assert (
        stdout
        == """Launching a worker on all queues