Add test to ensure AutoContext adds tasks to queue

Also ensure they are added correctly in batches.
Add tests with None batch_size and not tasks

When batch_size is None, AutoContext will act like Context, where all
tasks are inserted at once when the context is exited.

Ensujre that when no tasks are added, there are no errors.
Merge branch 'auto_context' into auto_context_async