title: Is there any way to change the Celery config programmatically, after app init?
body: <p>I have set up a testing environment where I have Celery workers actually running in other processes, so that the full functionality of my system with Celery can be tested. This way, tasks actually run in a worker process and communicate back to the test runner, and so I don't need <code>CELERY_ALWAYS_EAGER</code> to test this functionality.</p>
  
  <p>That being said, in some situations I have tasks which trigger off other tasks without caring when they finish, and I'd like to create tests which do - that is, to wait for those subtasks to finish. <em>In these cases</em>, the simplest approach seems to be to run <em>just these tests</em> eagerly (i.e. with <code>CELERY_ALWAYS_EAGER</code> set to true).</p>
  
  <p>However, I don't see a straightforward way to change the config after Celery is initialized... and indeed, from a glance at the source code, it seems that it assumes the config <em>won't change</em> once the app starts.</p>
  
  <p>This makes sense for a lot of options, since the worker would have to actually see the change, and changing it from the main program wouldn't do anything. But in the case of <code>CELERY_ALWAYS_EAGER</code>, this makes sense for the main program to be able to change it.</p>
  
  <p>Is there any straightforward/well-supported way to do this? If not, what's a preferably not-too-hacky way to do this?</p>
  
  <p>Another option is to make the task in question return the task ids it started off, so that the test can then wait on them... but I don't like the idea of changing my API for the sole purpose of making it runnable in a unit test.</p>